简体   繁体   English

为什么即使登录记录存储在会话中,在清除缓存后系统仍会注销?

[英]Why a system logout occurs after the cache is cleared even though the login records are stored in the session?

When we login to the system, we are storing some records to the session and on logout the session is cleared out. 登录系统时,我们将一些记录存储到会话中,并在注销时清除会话。

Now, when a user is logged into the system, how comes that the page is automatically logged out if user clears the cache from the browser? 现在,当用户登录到系统时,如果用户从浏览器中清除了缓存,该页面如何自动注销?

We stored the login data to the session and at the time of clearing cache, we are clearing only the cookies and not the session, so basically are cookies affecting the logged in user data?. 我们将登录数据存储到会话中,并且在清除缓存时,我们仅清除cookie,而不清除会话,因此cookie基本上会影响登录的用户数据吗?

The cookie stored in the browser contains the session id and this is what is used to identify the session. 存储在浏览器中的cookie包含会话ID,这是用来标识会话的。 If you delete the cookie, how will your server know which session to retrieve? 如果删除cookie,服务器将如何知道要检索哪个会话? You can't delete the cookie if you want to retain the session 如果要保留会话,则无法删除Cookie

It is because your session id is stored into your cookies. 这是因为您的会话ID已存储在Cookie中。

If you won't delete it and only clear other cookies,then your system won't logout automatically. 如果您不删除它,而只清除其他cookie,那么您的系统将不会自动注销。

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

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