This may help. Not tested.
Add the Following functions to your User model.
public function getRememberToken()
{
return $this->remember_token;
}
public function setRememberToken($value)
{
$this->remember_token = $value;
}
public function getRememberTokenName()
{
return 'remember_token';
}
I have the same problem, I have my User model with those 3 methods, I even changed the driver value to 'cookie' in the app/config/session.php file and it stills not working, I'm using laravel 4.2.4 btw
swgj19 said:
sounds familiar
Link The link is not working
Whoops, here is the link
I think we are working on something similar. My mistake was just a typo. Let me know if I can help you. Show all your code in a Pastebin and link back so I can help.
In the meantime, make sure your array is setup correctly like this example
$auth = Auth::attempt(array(
'email' => Input::get('email'),
'password' => Input::get('password'),
'active' => 1
));
Like @Sikandhar said, check to make sure the three token functions are in you User model according to a recent update
public function getRememberToken()
{
return $this->remember_token;
}
public function setRememberToken($value)
{
$this->remember_token = $value;
}
public function getRememberTokenName()
{
return 'remember_token';
}
make sure your table is protected in the User model and is named the same as in your databse.
You said you already made a field in the database for remember_token varchar(255) and NULL.
Set your auth attempt array to a variable and do a var_dump($variable) to see if any data is going through.
It is probably a typo like I had, that is why it is returning False.
It seems like it is working. I just updated the token functions. Anyway thanks very much!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community