webconfig页面中的会话超时 [英] session timeout in webconfig page

查看:168
本文介绍了webconfig页面中的会话超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何根据用户类型设置不同的会话超时。例如,我想为管理员设置40分钟的会话超时,为投资者设置20分钟。任何人请帮助我..

how can i set different session timeouts based on the user type. for example i want to set session timeout of 40 mins to admin and 20 mins for investor. Any one please help me..

推荐答案

您可以根据用户类型手动设置Session.Timeout属性。



用户成功登录后可以调用Session.Timeout属性。
You can manually set Session.Timeout property based on user type.

You can call Session.Timeout property after user successfully logs in.


在这种情况下,一种方法 - 将管理员和投资者页面分成不同的虚拟目录但在同一父级的层次结构中。在子目录中,根据需要覆盖父级的web.config设置。



另一种方法 - 依赖于Javascript,根据他的角色检查20分钟/ 40分钟的时间aspx,无论服务器会话时间如何,你都会过早地调用session.abandon for the role。

但是web.config应该有会话超时(所有角色的最大(时间))作为所有角色的MAX超时..



希望它有所帮助!
In that case, one approach - separate admin and investor pages into different virtual directories but in the hierarchy of same parent. In the child Directory, override the web.config settings of parent as required.

Another approach - Depend on Javascript which checks 20mins/40mins time out based on his role into aspx, Irrespective of server session time, you will call session.abandon for the role prematurely.
But web.config should have session time out ( max(time) of all roles) as MAX of all role timeouts..

Hope it helps!


我们需要在运行时为给定用户实现Session.TimeOut功能授权他们
We need to implement the Session.TimeOut Functionality for the given user at runtime while authorizing them


这篇关于webconfig页面中的会话超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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