DChelcun
DChelcun

Reputation: 15

Sitecore 8 - Session times out at 1 minute

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?

Upvotes: 0

Views: 1980

Answers (2)

Mark Cassidy
Mark Cassidy

Reputation: 5860

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

Upvotes: 5

Slashy
Slashy

Reputation: 1881

You can set a Timeout for a session using this:

  Session["User ID"] = "XX";
  Session.Timeout = 600000;

This would limit your session to 10 minutes for example.

Goodluck.

Upvotes: -2

Related Questions