mercredi 1 février 2017

Redirect the user to the log-in page after session expired - Laravel 5

Goal

I'm trying to redirect my user to my login page as soon as their session expired or log-out.

Example :

If they log-out, and try to click on any link, they should get redirected to the log-in page.


I have my log-in route declared like this

Route::get('/',['as' => 'login', 'uses'=>'AuthController@getSignIn']);


Then, I tried to configure it in config/session.php

/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/

'lifetime' => 120,
'expire_on_close' => true,
'expired-session-redirect' => url('/')


As soon as my user session is expired, I click on other linked, I didn't get redirect to my log-in page ?

What else do I need to do to achive something like that ?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2kqQCba
via IFTTT

Aucun commentaire:

Enregistrer un commentaire