Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is Session::put() data stored using database session driver in Laravel PHP?

I'm currently using the database session driver to store my sessions in Laravel.

I understand that the user sessions are stored in the database, but does the data from a Session::put get stored?

For example:

Session::put('userID', $user->id);

Where is the data about the userID being stored?

like image 390
Brandon Romano Avatar asked May 26 '26 17:05

Brandon Romano


1 Answers

Under default settings your sessions are stored in a table called 'sessions' in your default database connection.

Each session will have a payload which contains all sorts of data, but your userID will be in the payload for your session's row somewhere.

like image 112
alexrussell Avatar answered May 28 '26 07:05

alexrussell