Search code examples
laravellaravel-5.7session-managementinvalidargumentexceptionlaravel-session

Unable to resolve NULL driver for [Illuminate\Session\SessionManager]


I am using Laravel 5.7. My application is working fine last night. but suddenly this error appears. I did not change any file. Now I am searching for a solution but I did not find any. I am new on laravel I am not familiar with core files of Laravel. please check the error in the attached image.

here is .env session portion

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

And this is env file code

I dont have any file session.php file in config


Solution

  • Going of the conversation in the comments, the issue is that you don't have a session.php inside your config directory. The reason this is an issue is because Laravel will use that config file to get the name of the session driver and, like all config values, if it isn't present it will just return null.

    Adding the default session config file to that directory should solve your issue.