I am trying to implement a customer login system on my website built on Sitecore 8. When a customer correctly enters their username and password (checked against an external database), I set
Session["User ID"] = USER_ID;
and redirect to the home page. This all works fine except the Session["User ID"] variable clears after 1 minute, resulting in the user being logged out. I've tried extending the sessionState timeout parameter in web.config to 60 but that did not work. Any ideas on why this is happening?
You can set a
Timeout
for a session using this:This would limit your session to 10 minutes for example.
Goodluck.
Yes. Likely your page doesn't include proper DMS VisitorIdentification, resulting your session in being flagged as a robot. Robots get a short session expiration to save server resources.
Described here: http://zzzgo.com/2015/03/24/Sitecore-session-timeout-quickly-1-min-when-not-logged-in.html
And here: Sitecore 7.5 MVC and HttpContext.Session.Timeout set to 1 min