Global.asax Session_End()...

Discussion in 'ASP .Net' started by James Hunter Ross, Oct 19, 2005.

  1. Friends,

    In our Global.asax file we implement Session_End() which grabs our own
    object and then calls our own logout() method to tidy things up. Code is
    below. (We wrap this in try/catch, but presently ignore exceptions, perhaps
    we'll start logging something to help us figure this out.)

    RSWeb.RSWebApp webAppInfo = RSWebApp.GetRSWebApp(Session);
    webAppInfo.Logout();

    But, it appears that our logout isn't reliably being called, and licenses
    are being orphaned. It appears that when a session times-out Session_End()
    is not being called. SO my question...

    Is it a good idea for us to assume Session_End will always be called? In
    what situations might we expect it not to get called? (Process or
    application restarts, I would guess, which is fine for us.)

    Any words on this will be very much appreciated. Thank you very much for
    anytime you spend on this.

    James Hunter Ross
     
    James Hunter Ross, Oct 19, 2005
    #1
    1. Advertising

  2. James Hunter Ross

    Jeff Siver Guest

    In my experience, I don't use Session End as it isn't that reliable. Having
    said that, I haven't tried it in ASP.NET; just in ASP. But, in ASP, it
    never worked reliably. Also, I would suspect similar problems in ASP.NET.
    One thing I noticed in the SQL Session State implementation is that MS uses
    a SQL Job to delete expired sessions instead of tying into the Session End
    event. So if they don't use it, I wouldn't use it.

    Jeff


    "James Hunter Ross" <> wrote in message
    news:%...
    > Friends,
    >
    > In our Global.asax file we implement Session_End() which grabs our own
    > object and then calls our own logout() method to tidy things up. Code is
    > below. (We wrap this in try/catch, but presently ignore exceptions,
    > perhaps we'll start logging something to help us figure this out.)
    >
    > RSWeb.RSWebApp webAppInfo = RSWebApp.GetRSWebApp(Session);
    > webAppInfo.Logout();
    >
    > But, it appears that our logout isn't reliably being called, and licenses
    > are being orphaned. It appears that when a session times-out
    > Session_End() is not being called. SO my question...
    >
    > Is it a good idea for us to assume Session_End will always be called? In
    > what situations might we expect it not to get called? (Process or
    > application restarts, I would guess, which is fine for us.)
    >
    > Any words on this will be very much appreciated. Thank you very much for
    > anytime you spend on this.
    >
    > James Hunter Ross
    >
    >
     
    Jeff Siver, Oct 20, 2005
    #2
    1. Advertising

  3. On the contrary, it's very reliable. You need to be familiar with the rules
    that govern its firing though.
    http://support.microsoft.com/default.aspx?scid=kb;en-us;555082

    --
    Regards,
    Alvin Bruney [MVP ASP.NET]

    [Shameless Author plug]
    The Microsoft Office Web Components Black Book with .NET
    Now Available @ www.lulu.com/owc
    Forth-coming VSTO.NET - Wrox/Wiley 2006
    -------------------------------------------------------



    "Jeff Siver" <> wrote in message
    news:...
    > In my experience, I don't use Session End as it isn't that reliable.

    Having
    > said that, I haven't tried it in ASP.NET; just in ASP. But, in ASP, it
    > never worked reliably. Also, I would suspect similar problems in ASP.NET.
    > One thing I noticed in the SQL Session State implementation is that MS

    uses
    > a SQL Job to delete expired sessions instead of tying into the Session End
    > event. So if they don't use it, I wouldn't use it.
    >
    > Jeff
    >
    >
    > "James Hunter Ross" <> wrote in message
    > news:%...
    > > Friends,
    > >
    > > In our Global.asax file we implement Session_End() which grabs our own
    > > object and then calls our own logout() method to tidy things up. Code

    is
    > > below. (We wrap this in try/catch, but presently ignore exceptions,
    > > perhaps we'll start logging something to help us figure this out.)
    > >
    > > RSWeb.RSWebApp webAppInfo = RSWebApp.GetRSWebApp(Session);
    > > webAppInfo.Logout();
    > >
    > > But, it appears that our logout isn't reliably being called, and

    licenses
    > > are being orphaned. It appears that when a session times-out
    > > Session_End() is not being called. SO my question...
    > >
    > > Is it a good idea for us to assume Session_End will always be called?

    In
    > > what situations might we expect it not to get called? (Process or
    > > application restarts, I would guess, which is fine for us.)
    > >
    > > Any words on this will be very much appreciated. Thank you very much

    for
    > > anytime you spend on this.
    > >
    > > James Hunter Ross
    > >
    > >

    >
    >
     
    Alvin Bruney - ASP.NET MVP, Oct 21, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QmVsYQ==?=

    Problem with Session_End in Global.asax

    =?Utf-8?B?QmVsYQ==?=, Apr 13, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    3,581
    coollzh
    Apr 13, 2004
  2. Samuel Stanojevic
    Replies:
    1
    Views:
    978
    Samuel Stanojevic
    Sep 15, 2004
  3. =?Utf-8?B?YmNoYXJsZXM=?=

    global.asax and global.asax.cs

    =?Utf-8?B?YmNoYXJsZXM=?=, Oct 4, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    913
    =?Utf-8?B?YmNoYXJsZXM=?=
    Oct 5, 2004
  4. Kim Bach Petersen
    Replies:
    5
    Views:
    15,881
    JamesJM
    Aug 3, 2011
  5. Mark Rae

    Global.asax / Global.asax.cs in v2

    Mark Rae, May 23, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    3,210
    Mark Rae
    May 23, 2006
Loading...

Share This Page