如何在asp中实现多用户登录并保持会话活动五个小时的用户ID和密码 [英] How to Implement multiuser login in asp and keep session alive for five hours of user id and password
本文介绍了如何在asp中实现多用户登录并保持会话活动五个小时的用户ID和密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在asp.net c#
网站上的时间概念中集成多用户登录以及如何防止自动注销,直到用户点击退出按钮
< br $>
谢谢
How to Integrate multiuser login at a time concept in a website of asp.net c#
and how to prevent auto logout untill untill user click on logout button
Thanks
推荐答案
甚至不要让会话保持活动5个小时:每个会话使用不建议服务器上的内存,并延长超过默认的20分钟的时间 - 它可能导致严重的性能问题。
相反,将用户ID信息存储在cookie,并给出一个到期日期。当用户回发时更新cookie,他们在服务器端获得五个小时而没有任何性能开销。
Don't even try to keep a Session alive for 5 hours: each Session uses memory on the server, and extending the time past the default 20 minutes is not recommended - it can lead to severe performance issues.
Instead, store the userid info in a cookie, and give that an expiration date. Update the cookie when the user posts back, and they get their five hours without any performance overhead on the server side.
这篇关于如何在asp中实现多用户登录并保持会话活动五个小时的用户ID和密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文