public static function canUseSession()
    {
        // Get the session driver and check if it was started - fully inited by laravel
        $session = session();
        $driver = $session->getDefaultDriver();
        $drivers = $session->getDrivers();

        // Check if the driver is valid and started - allow using session
        if (isset($drivers[$driver]) && true === $drivers[$driver]->isStarted()) {
            return true;
        }

        return false;
    }
public static function canUseSession()
    {
        // Get the session driver and check if it was started - fully inited by laravel
        $session = session();
        $driver = $session->getDefaultDriver();
        $drivers = $session->getDrivers();

        // Check if the driver is valid and started - allow using session
        if (isset($drivers[$driver]) && true === $drivers[$driver]->isStarted()) {
            return true;
        }

        return false;
    }
public static function canUseSession ( ) { // Get the session driver and check if it was started - fully inited by laravel $ session = session ( ) ; $ driver = $ session -> getDefaultDriver ( ) ; $ drivers = $ session -> getDrivers ( ) ; // Check if the driver is valid and started - allow using session if ( isset ( $ drivers [ $ driver ] ) && true === $ drivers [ $ driver ] -> isStarted ( ) ) { return true ; } return false ; }
Checks the current setup if session driver was booted - if not, it will generate random hash.

@return bool
Checks the current setup if session driver was booted - if not it will generate random hash .