authentication - Laravel Auth::attempt Expiring session -
i have come across strange problem after login via auth::attempt()
session expires.
i using following code
route::post('user/auth', function(){ if (auth::attempt(array('email' => 'email@yahoo.com', 'password' => 'some password','user_status'=>'active'))) { $userid = auth::id(); } });
every time run call user/auth
, session values destroyed , new token set laravel. happening on hosting server. while on local computer working fine.
please have invested 2 days finding problem.
i have set links explaining:--
on following link using auth::attempt while displaying of session variables. please notice _token. page set session variables being destroyed.
http://behungry.co.in/set/session
on following page calling session::all() display sessions. please check _token variable here. both different. while expecting them same , persist sessions.
http://behungry.co.in/get/sessions
following app/config/session file's content
'driver' => 'database', 'lifetime' => 120, 'expire_on_close' => false, 'files' => storage_path().'/sessions', 'connection' => null, 'table' => 'sessions', 'lottery' => array(2, 100), 'cookie' => 'laravel_session', 'path' => '/', 'domain' => '', 'secure' => false,
sessions working fine on rest of website. have tried both file , database drivers. appreciated. thanks.
can change domain
'domain' => null,
i explaned in there https://stackoverflow.com/a/28774751/2438520
Comments
Post a Comment