Laravel: What is “remember_token” in the “users” DB table?

前端 未结 4 526
春和景丽
春和景丽 2021-01-31 08:22

Is it safe to use the remember_token in the users table for authenticating the user into the application?

What is the purpose of this token? Currently, I\'m

4条回答
  •  一个人的身影
    2021-01-31 08:52

    I had to add the remember_token to my users table migration in order for Auth::logout() to work properly.

    Added remember_token to my migrations as such.

    increments('id');
                $table->string('lname', 32);
                $table->string('fname', 32);
                $table->string('username', 32);
                $table->string('email', 320);
                $table->string('remember_token', 100);
                $table->string('password', 64);
    
                $table->timestamps();
            });
        }
    
        /**
         * Reverse the migrations.
         *
         * @return void
         */
        public function down()
        {
            //
            Schema::drop('users');
    
        }
    
    }
    

    From the command-line you the have to drop the users table, then migrate/seed.

提交回复
热议问题