问题描述:

I am working on laravel 4.the logout code is-

Auth::logout();

return Redirect::to('users/signin')

->with('message', 'You are now logged out');

at the time of sign out it is showing -

 Column not found: 1054 Unknown column 'remember_token' in 'field list' (SQL: update `users` set `updated_at` = 2014-07-25 11:09:49, `remember_token` = some code where `id` = 1)

i am not using any remember token as there is no concept of "remeber me" featur.what shold i do for this? should i add remember_token to db?

网友答案:

is it compulsory to user “remeber_token field”?

Yes - it is compulsory for Laravel >=4.1.26 due to a possible security issue.

should i add remember_token to db?

Yes - you need to add this. There are some specific instructions on the upgrade, and the changes to your model you need to include: http://laravel.com/docs/upgrade#upgrade-4.1.26

Specifically you need to

  1. add a new, nullable remember_token of VARCHAR(100), TEXT, or equivalent to your users table
  2. Next, if you are using the Eloquent authentication driver, update your User class with the following three methods:

-

public function getRememberToken()
{
    return $this->remember_token;
}

public function setRememberToken($value)
{
    $this->remember_token = $value;
}

public function getRememberTokenName()
{
    return 'remember_token';
}
相关阅读:
Top