Reputation: 130
I need some information about how Laravel cache session.
I am using file based Laravel session.
Scenario:
My question is, where does Laravel store the session data? How to effectively erase the session data so that even a whole new physical session file recreated with the same filename wouldn't restore the old data.
The above issue has been resolved.
Another issue arise, running below code:
Session::forget('member');
Session::flush();
Session::regenerate();
The old session wasn't flush at all, all the data is still there. But the newly generated session start fresh.
How can I really flush the old session before moving to new session?
Upvotes: 0
Views: 1284
Reputation: 130
Below is the correct way to persist the new data in old session:
Session::forget('member');
Session::flush();
Session::save(); // trigger save to old session
Session::regenerate(true); // pass true to regenerate would delete the old session file.
Upvotes: 1
Reputation: 383
Under default settings your sessions are stored in a table called 'sessions' in your default database connection
destroy it
Upvotes: 0