I have read and follow the documentation of HTTP Sessions in Laravel, I've just curious why session tables is always in one row, when I use Session::put('key', 'value');
, I can store the data in the session, but when I store another session, the row will not add.
Even I used Session::forget('key');
and Session::flush();
, this row remains.
That is because Session::put()
is adding data to the current session, not creating a new one. To create a new session, log in with a new user.
On your question how you can delete the row, you really shouldn't. Just invalidate them, which Laravel does automagically on logout or after some time of inactivity.