Deleting Session Variables after use

  • Thread starter Thread starter Simon Harvey
  • Start date Start date
S

Simon Harvey

Hi all,

Is it prudent to delete items that you've stored in the session if you are
sure that these values won't be needed again?

I'm also wondering if things would be arsed up if the user went to a page
that deleted session information and then used his/her back button to go to
a precious page. Presumably the session data would be gone and my app would
get mighty pissed

Is that the case

Any help would be very greatfully received.

Many thanks

Simon
 
Hi Simon,


Is it prudent to delete items that you've stored in the session if you are
sure that these values won't be needed again?

It's a good practice to delete the session variables once you know that its
no more required, this will help you to free your server memory and hence
making your app more efficient.


I'm also wondering if things would be arsed up if the user went to a page
that deleted session information and then used his/her back button to go to
a precious page. Presumably the session data would be gone and my app would
get mighty pissed

You can look in the application level error handling, which will redirect
the user to some friendly error page. Also you can check for the session_end
event in the global.asax .



HTH

Regards

Ashish M Bhonkiya
 
Back
Top