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 using it in forms to check whether the user is logged in - if the token is not present, I show the login screen. Each time the user logs out, this token is regenerated.

推荐答案

不,它不应该用来验证身份.框架使用它来帮助防止Remember Me个cookie劫持.该值在登录和注销时刷新.如果一个cookie被恶意的人劫持,注销会使被劫持的cookie变得无用,因为它不再匹配.

Refer to this documentation:

https://laravel.com/docs/4.2/upgrade#upgrade-4.1.29

Laravel相关问答推荐

哈希:check()不返回预期结果Laravel 10

无法在终端cPanel中打开输入文件:artisan

Laravel-如何按第三表关系对数据进行分类

查询Laravel中的图形

自定义验证在表单请求上始终返回 true laravel

如何在 Laravel 中使用 return 停止 Trait php 的执行

V-icon 在 Vuetify 3 中不显示图标

如何计算具有特定 ID Laravel 的行

如何通过 Controller 访问 Laravel 中 Model 的值?

如何在 laravel livewire 中按 bool 值排序数组

如何在 Laravel 中填充以后执行的条件

Laravel 中的 index()" 是什么意思?

Laravel:如何通过 id 从集合中删除项目

Eloquent 的集合方法,例如 only 或 except 返回一个空集合

eloquent的搜索/自定义属性的位置

将图标添加到 Laravelcollective 提交按钮

Laravel 5 - 为包创建 Artisan 命令

Laravel 5 - 跳过迁移

phpunit 命令不适用于 Windows 7 上的 laravel 4

laravel中的动态网址?