关于session时间过早丢失session?求助
我在web程序中后台管理,用了sesion登录验证
在登录中写的是:
Session["Admin"] = "admin";
在commonfun.cs中用了验证
public static void IsAdmin()
{
//查看是否为超级管理员
try
{
if (HttpContext.Current.Session["Admin"].ToString() != "admin")
{
HttpContext.Current.Response.Write(@"<script>alert('你还没有登录或登录超时!');parent.window.location.href='Admin_Login.aspx';</script>");
}
}
catch
{
HttpContext.Current.Response.Write(@"<script>alert('你还没有登录或登录超时!');parent.window.location.href='Admin_Login.aspx';</script>");
}
}
然后在后台管理的各页中用了调用这个判断
最后在web.config中配置了session
<sessionState mode="InProc" timeout="30"/>
可是,每次后台登录后,差不多二分钟如果没有动作,就丢失了session,就会提示需要登录了,怎么办??
怎么检查现在我的网站的实际session的time out时间是多久,如何更改?