Sorry Teo, I meant to refer to the Session OnEnd event (not the Abandon
method). You can handle this event, but only once the session times
out. The server cannot know what the user does after the content has
been served (especially re the closing of browser windows). All the
server knows is when the last request was made from a client with a
particular session id.
teo wrote:
> Mmmmh... what are the quirks about the
> the Abandon event of the Session object ?
>
>
>
> >Hello Teo,
> >
> >You've happened upon a common problem in web application programming
> >that has no reliable solution. Others may suggest using the Abandon
> >event of the Session object, but this too has its quirks. Perhaps you
> >can simply let the object in the Cache expire, or just overwrite it
> >when appropriate?
> >
> >teo wrote:
> >> I have an object stored in the Page.Cache.
> >> (its name is the SessionId number).
> >>
> >> I'd like to remove it from the Cache when the user close
> >> or abandons 'mySite.aspx' page
> >> (when he closes the browser, when he jumps to another site,
> >> if the connection is broken, if an Error occur and the user is
> >> istantly redirected to another page ...)
> >>
> >> How to detected all this circumstances?
> >>
> >> I used the Unload and then the Dispose events of the Page object,
> >> but the first is continuosly fired (at every postback)
> >> and the second is never fired,
> >> so they seem to be both unuseful.
|