|
-
Jul 30th, 2012, 02:05 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Session.Abandon
Code:
protected void Page_Load(object sender, EventArgs e)
{
string sBeforeAbandon;
string sAfterAbandon;
sBeforeAbandon = Session["name"].ToString();
Session.Abandon();
if (Session["name"] != null)
{
sAfterAbandon = Session["name"].ToString();
}
}
IN sBeforeAbandon I am getting "sonia". After that I write Session.Abandon(), But in sAfterAbandon I am still getting the "sonia". WHy Session.Abandon means destroys all the session objects, then why I am getting "sonia" after Session.Abandon()
-
Jul 30th, 2012, 02:27 PM
#2
Re: Session.Abandon
 Originally Posted by MSDN
When the Abandon method is called, the current Session object is queued for deletion but is not actually deleted until all of the script commands on the current page have been processed. This means that you can access variables stored in the Session object on the same page as the call to the Abandon method but not in any subsequent Web pages.
MSDN - Session.Abandon Method
-
Aug 1st, 2012, 04:10 PM
#3
Thread Starter
Hyperactive Member
Re: Session.Abandon
Session.Abandon method is actually delete that session object completely when that current process is complete.
In variable sAfterAbandon still “sonia” is dere, because FORM LOAD PROCEDURE IS NOT COMPLETED.
SOLVED -- I AM not able to Mark the thread as Resolved!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|