Assigning Session to nothing or Session.Abandon

I have seen so many developers once they wanted to destroy session, they used

Session(“A”) = Nothing

Its not a good practice to assign nothing object.

Correct:

 

Session.Abandon

 

The Session.Abandon method basically destroys a user session.

One thing I would add the current Session object will not delete untill the script on the current page have been processed completely.

Sorry for your inconvience, I have my official blog please visit for complete article:

http://blog.joggee.com/?p=143

 

 

 

 

 

About these ads

2 thoughts on “Assigning Session to nothing or Session.Abandon

  1. Wounderfull all most all the developers do so. Before readind this artical i also use same like
    Session(”A”) = Nothing
    Also FormsAuthentication.SignOut() is new thing for me.
    Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s