Laravel sessions not available in native PHP?-Collection of common programming errors

Laravel doesn’t use PHP sessions, so forget session_start(), $_SESSION, etc.

If you’re running with file session driver, the session data is stored in a file in storage/sessions. You can obtain the name of the file by reading the Laravel session ID from the cookie. So the hacky way to solve your problem would be to write some code that obtains the session ID from the cookie and then looks for the file with that name in the storage/sessions folder, read that file in, json_decode() it and you can read the whole thing.

If you’re running with cookie session driver, all of the session data is stored in the cookie, but it is encrypted, so you’d have to have a copy of the key (which should be in application/config/application.php) and then figure out what encryption method Laravel is using so you can decrypt it. Then you can read all the session variables.

To achieve what you’re hoping to achieve – that is, figure out if the current person is authorized, it might be better to build an API into your app and secure it so that it can only be accessed by localhost. Not a great solution from a performance standpoint, but potentially more elegant because you’re not hacking around with the internals of Laravel session management.