【发布时间】:2016-05-25 00:46:35
【问题描述】:
我有一个使用两个前端 CD 服务器和一个带有粘性会话的负载平衡器构建的 Sitecore 7.5 站点。负载均衡器的默认超时为 5 分钟。 Sitecore 站点的 ASP.NET 默认会话超时值为 20 分钟。我一直在收到有关该网站随机注销人员的报告。我刚刚进行了以下实验:
- 在新浏览器中开始新会话
- 在我的手机上启动了一个计时器
- 几乎不断地点击站点中的不同页面。我最长的空闲时间大概是 30 秒。
- 大约 10 到 15 分钟后,我突然注意到我不再登录应用程序
我不知道为什么会这样。这是我用来登录的代码。
protected void ButtonLogin_Click(object source, EventArgs e)
{
bool loginSuccess = Sitecore.Security.Authentication.AuthenticationManager.Login("extranet\\" + TextLoginUsername.Text, TextLoginPassword.Text, CheckKeepLoggedIn.Checked) || (Sitecore.Security.Authentication.AuthenticationManager.Login("sitecore\\" + TextLoginUsername.Text, TextLoginPassword.Text, CheckKeepLoggedIn.Checked));
if (loginSuccess)
{
LabelLoginError.Visible = false;
Sitecore.Analytics.Tracker.Current.Session.Identify(Sitecore.Context.GetUserName());
Sitecore.Analytics.Tracker.Contact.Tags["Full Name"] = Sitecore.Context.GetUserName();
Response.Redirect(ButtonLogin.PostBackUrl);
return;
}
//Otherwise log as error.
LabelLoginError.Text = "Username/password combination was incorrect.";
LabelLoginError.Visible = true;
}
有什么想法吗?
【问题讨论】:
-
几个问题: 1. 您是否在 ASP.NET MVC 方式中使用 Sitecore? 2. 如果是,您使用的是 Castle Windsor 还是其他 IoC 框架?
标签: session login timeout sitecore sitecore7.5