Hi there,
I'm facing some issues with session. After login in and redirecting to the homepage, my session isn't working.
If I do dd((Auth::check()) before redirecting, session is ok but I do this after redirecting session is not working at all.
Here is some parts of my code:
Route:
Route::get('/', function()
{
return View::make('accueil');
});
Route::controller('users', 'UsersController');
Users controller
public function postLogin() {
if (Auth::check()) {
Session::flash('message', 'Vous êtes déjà connecté.');
return Redirect::to('/');
}
$user = array(
'pseudo' => Input::get('pseudo'),
'password' => Input::get('password')
);
if (Auth::attempt($user)) {
/*Session::flash('message', 'Vous êtes connecté.');*/
return Redirect::to('/');
} else {
Session::flash('message', 'Vos identifiants ne sont pas corrects.');
return Redirect::back();
}
}
Thanks in advance and sorry if i'm doing some mistakes, english isn't my native language