Click here to Skip to main content
15,896,259 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In My Project I have used Session In each Page , I have used a hyperlink for Logout,
When I click On the page i redirect That to another Page, That page is blank. and On that page in side page load I have written

C#
Session.Abandon();
Response.Redirect("~/Login.aspx?msg=Successfully Logout");


Is This good to use Session.Abandon();

But My problem Is that Now When I logout It Takes So much Time To Logout.

What Can I do?
Please Help Me.
Thanks.
Posted
Updated 11-Nov-11 19:35pm
v2

hi,

use Session.Clear()
that s enough
 
Share this answer
 
Session.Abandon() destroys the session and the Session_OnEnd event is triggered.

Session.Clear() just removes all values (content) from the Object. The session with the same key is still alive.

So, if you use Session.Abandon(), you lose that specific session and the user will get a new session key. You could use it for example when the user logs out.

Use Session.Clear(), if you want that the user remaining in the same session (if you don't want him to relogin for example) and reset all his session specific data.
 
Share this answer
 
use global.aspx
in that predefined methods are avilable
like session_start,session_stop
 
Share this answer
 
Just go through the link. hope this one will help u

http://www.highoncoding.com/Articles/108_When_is_Session_End_Called__.aspx[^]
 
Share this answer
 
C#
Session.Abandon();
Response.Redirect("../Login.aspx");


This will help u.

Regards
Prince Antony G
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900