[英]Where do I store my tokens server side?
I made (myself) an authentication system for my ExtJS app. 我为自己的ExtJS应用程序制作了一个身份验证系统。
When I login my server generates a token which is stored by my client. 登录时,服务器生成一个令牌,该令牌由我的客户端存储。 When I have to send a request to my server I put my token in the request headers, but what is the common way to check the token server side? 当我必须向服务器发送请求时,将令牌放入请求标头中,但是检查令牌服务器端的常用方法是什么?
Do I have to store the token in my database, do a select query, etc.? 我是否必须将令牌存储在数据库中,执行选择查询等?
Does it in another way? 是否以其他方式? Querying my database 1 more time for each request doesn't seems a good idea for me (but maybe I'm wrong) 对于每个请求多查询我的数据库1次对我来说似乎不是一个好主意(但也许我错了)
这应该可以回答您的问题- 有状态头脑的无状态会话 !
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.