登录后携带用户ID的最佳方式 [英] best way to carry user id after login

查看:131
本文介绍了登录后携带用户ID的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想知道在整个应用程序中携带用户ID的最佳方式,直到应用程序结束,即用户注销。

截至目前我我正在使用这种方式 -

1)用户登录

2)他的用户ID存储在会话中

3)每一页应用程序正在访问会话

4)注销时,清除会话



主要问题是会话超时,我认为无法阻止会话超时事件并不完全在我的手中。它也依赖于服务器。因为每次在每个页面上我将会话的到期时间设置为24小时,但它在一些服务器中在1分钟内销毁,在另一台服务器中销毁10分钟。



请告诉我实用的Web应用程序如何使用用户凭证存储方法。



请不要提及cookies.old浏览器默认不支持它。

Hi,
I want to know the best way to carry user id all over the application untill the application end ,i.e user log out.
As of now I am using this way--
1)user logged in
2)his user id is stored in session
3)every page of that app is accessing the session
4)on logout,clear the session

Main problem is session timeout which I think can not be prevented and the session timeout event not fully in my hand.It is also dependent on server.Because each time on each page I set the expire time of session to 24 hrs,but it destroys in 1 minute in some server and 10 minutes in another server.

so pleaSE tell me how the practical web application uses the user credential storing method.

Please don't mention cookies.old browser do not support it by default.

推荐答案

试试这个: ASP.NET:使用StateServer移动进程外进程 [ ^ ]


这篇关于登录后携带用户ID的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆