Support the ongoing development of Laravel.io →
Authentication Input Session

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?

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.