I have a Sitecore 7.5 site built with two front end CD servers and a load balancer with sticky sessions. The load balancer has a default timeout of 5 minutes. The Sitecore site has the ASP.NET default session timeout value of 20 minutes. I have been getting reports of the site randomly logging people out. I just ran the following experiment:
- Started a new session in a new browser
- Started a timer on my phone
- Almost continually clicked on different pages in the site. About the longest time that I was idle was maybe 30 seconds.
- After about 10 - 15 minutes I suddenly noticed that I was no longer logged in to the application
I can not figure out why this is happening. This is the code I am using to do login.
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;
}
Any ideas?
Did you check assignment to the CD server? You could check that in your browser console. Maybe your cookie expired and your Load Balancer just switched server which had been using by your user?
And one more thing - do you use SSL to secure connection? In the past one of my colleagues/administrators had some problems with properly configuration LB with SSL.