6

We have some logic that we trigger based on a new session starting by using Session_OnStart in Global.asax. This is fine, except that for some reason this is not being called when a page is viewed after the session times out but the browser is not closed.

Is Sitecore doing something to artificially extend the session infinitely while the browser is open?

Is there another hook we should look at?

Using Sitecore 8.0

  • Can you specify what version of Sitecore you are using? – Pete Navarra Sep 22 '16 at 22:15
  • 1
    In Sitecore 8, with Analytics Tracker, the Tracker will keep the session open until the configured timeout occurs. The default value I need to look up, but I think it's a few minutes. Also, do you mean Session_Start() in the Global asax? You mention Session_OnStart in the question. Just clarifying. – Pete Navarra Sep 22 '16 at 22:18
  • Would be good to know on what browser this happens? (All?) and if you are referring to close a tab in browser or need to close the browser app? – Adrian C. Sep 23 '16 at 9:02
  • Sitecore 8.0 (updated the tag). We are using Session_OnStart, my understanding is that you can use it interchangeably with Session_Start (and I've tried both with similar results I think). I did monitor the Session database, and waited until my session rows were cleared before refreshing the page. A new row was created in the db after that, but the session identifier was the same (my session cookie was still in the browser). I'll check on if closing the tab is sufficient or if closing the app is a requirement. – Matt Connolly Sep 23 '16 at 17:48
  • If you clear cookies and cache, does this issue persist? – Kyle Trauberman Sep 23 '16 at 18:20
3

Hmm. You don't mention if you're using InProc or mongo session states. But it might not be relevant.

Sitecore overrides the default ASP.NET SessionIdManager manager - not entirely sure why. What is clear however, that it is in this puppy it is controlled, whether a new Session ID should be issued on timeout. So 2 things to try:

  1. Add this attribute to your <sessionState> element. regenerateExpiredSessionId="true"

And if that doesn't work:

  1. remove this attribute from the <sessionState> element. sessionIDManagerType="Sitecore.SessionManagement.ConditionalSessionIdManager"

Only option 1 would be a suitable end-all solution to your issue. If you have to take Sitecore's ConditionalSessionIdManager out of comission, it strongly suggest you have an issue that needs to be brought to Sitecore Support.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.