简体   繁体   English

.net会话和用户cookie持久身份验证

[英].net Session and user cookie persistent authentication

Here is the scenario: 这是场景:

A user is logged on and a Session has been created on the server along with an authentication cookie on the client side. 用户已登录,并已在服务器上创建了会话以及客户端上的身份验证cookie。

The Session timeout is set to 20 minutes. 会话超时设置为20分钟。

After 25 minutes of inactivity the user goes back onto the website, so his Session does not exist anymore but the authentication cookie still exists. 闲置25分钟后,用户返回网站,因此他的Session不再存在,但身份验证cookie仍然存在。

Based on the cookie what's the best and secured way to allow the user to get signed in automatically... 基于cookie,什么是允许用户自动登录的最佳和安全方式?

Thanks in advance for any help. 在此先感谢您的帮助。

First, sign on automatically, should be a option, some users doesn't want it. 首先,自动登录应该是一种选择,某些用户不希望这样做。

Second, if the user has that option active and the authentication cookie still exists you only need to create a new session. 其次,如果用户激活了该选项,并且身份验证cookie仍然存在,则只需创建一个新会话。 You don't need to really authenticate the user, just give him a cookie. 您不需要真正验证用户身份,只需给他一个cookie。 :-P. :-P

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM