关于网站单点登录的问题?
大家好,我的网站()使用的是单点登录,可是我发现,在用户登录后,如果关闭浏览器后,无法再次登录.即cache[key]中会有上次登录时赋的值.如何处理?string str_User = Convert.ToString(Cache[str_Key]);
if (String.IsNullOrEmpty(str_User))
{
TimeSpan SessTimeOut = new TimeSpan(0, 0, HttpContext.Current.Session.Timeout, 0, 0);
HttpContext.Current.Cache.Insert(str_Key, str_Key, null, DateTime.MaxValue, SessTimeOut,
CacheItemPriority.NotRemovable, null);
Session["AdminID"] = str_Key;
Session["Admin"] = memberInfo.SName;
}
else
{
this.lbValid.Text = AppClass.OpenDialogForButton((Button)btnLoad, "您已经登录,请退出后再重新登录!");
}
----
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="60"/>
我设置了session的时效60分钟.