both login and logout is working except remember me is not working. When it log out and it was the check box is empty and no remember. I tried withInput(); of code somewhere maybe I am missing that part or true : false; I dont know which one. please take a look at the code.
public function postLogin()
{
$input = Input::all();
$rules = array(
'email' =>'required',
'password'=>'required');
$v = Validator::make($input,$rules);
if($v->fails())
{
return Redirect::to('login')
->withErrors($v);
} else {
$remember = (Input::has('remember')) ? true : false;
$auth = Auth::attempt(array(
'email'=> Input::get('email'),
'password'=>Input::get('password')
), $remember );
if($auth)
{
return Redirect::intended('admin');
} else {
return Redirect::to('login')
->withInput()
->with('errorMessage2', 'Email/password wrong, or account not activated.');
}
}
}
login.blade.php
<div class="field">
<input name="remember" type="checkbox" id="remember">
<label for = "remember">Remember Me
</label>
</div>
any idea?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community