1

I'm trying to wire up the global.asax Session_Start event for an Umbraco site. I want to set certain user info into the session object every time a new session is created.

So far I have changed the Global.asax file to look like:

<%@ Application Codebehind="Global.asax.cs" Inherits="UmbracoCore.Global" Language="C#" %>

And my custom Global class looks like so:

namespace UmbracoCore
{
  public class Global : UmbracoApplication
  {
    public void Session_Start( object sender, EventArgs e )
    {
      Session[ "INIT" ] = 0;
      SessionHelper.InitialiseSession( Session, Request );
      //umbraco.library.setSession( "INITU", "1" );
    }
  }
}

I'm doing my custom logic to add stuff into the session in SessionHelper.InitialiseSession.

Now this all works, and the first time the page loads, I'm setting up the session object nicely. However, after the page has finished loading, the Session_Start method keeps firing every 10 seconds or so. The session in my browser is still valid with the server but I'm not sure why all these additional sessions are being created. Is this something Umbraco is doing?

I've already ruled out the issue with favicon.ico being missing, and my site isn't doing any switching between HTTP and HTTPS which might be resetting sessions.

If anyone could offer any help as to how I can stop all these additional sessions being created I'd greatly appreciate it.

ekad
  • 14,436
  • 26
  • 44
  • 46
Matt
  • 51
  • 5

1 Answers1

0

It's possible that this is one of the scheduled task that runs in the background checking for things like scheduled page publishes etc.

Try getting your session start to log the page that's being run and you should be able to straight away if that's the case, as the URL will be an Umbraco back office one.

Tim
  • 4,217
  • 1
  • 15
  • 21