PC Review


Reply
Thread Tools Rate Thread

[CACHE] Remove an Item on exiting application

 
 
teo
Guest
Posts: n/a
 
      29th Aug 2006
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.


 
Reply With Quote
 
 
 
 
KJ
Guest
Posts: n/a
 
      30th Aug 2006
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.


 
Reply With Quote
 
teo
Guest
Posts: n/a
 
      30th Aug 2006
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.


 
Reply With Quote
 
KJ
Guest
Posts: n/a
 
      30th Aug 2006
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i recover a clipboard item after exiting word Sharbeen Microsoft Word Document Management 1 1st Nov 2008 02:17 PM
Outlook 2003 - Exiting App leaves the cache version open =?Utf-8?B?TWlrZSBCcmFkc2hhdw==?= Microsoft Outlook Discussion 0 19th Apr 2005 01:26 PM
Exiting Application imbd4a Microsoft Access 6 7th Feb 2004 07:20 PM
Application Cache Remove Callback Issue =?Utf-8?B?R2xlbm4=?= Microsoft ASP .NET 1 4th Feb 2004 03:14 AM
Exiting an Application in VB.net tt Microsoft VB .NET 2 25th Sep 2003 06:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:11 PM.