Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I am using laravel 5.2 auth system to manage users but i have to delete a specific session variable after user logged out from the site. but i dont know where to place the session destroy function to achieve this.
Use Session::flush(); to delete all variable
Session::flush();
And Session::forget('key'); for particular key.
Session::forget('key');
Use any of these after Logout and before you redirect to some page which could look like as below
Logout
public function getLogout() { auth()->logout(); return redirect()->route('index'); }
Add a comment
i faced same issue and solved by using Session::forget('password_hash')
Session::forget('password_hash')
public function doLogout() { Session::forget('password_hash'); Auth::logout(); return Redirect::to(route( 'home').'/'); }
Find session values by dd(Session::all());
dd(Session::all());
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.