Go4Expert

Go4Expert (http://www.go4expert.com/)
-   ASP (http://www.go4expert.com/forums/asp/)
-   -   Clear session (http://www.go4expert.com/forums/clear-session-t3046/)

tsalexey544 17Feb2007 14:36

Clear session
 
Hi, I posted this question but somehow it is not here =(


When I release session objects I do this
Code:

Code:

session("username")=""

So whats the difference when I do this
Code:

Code:

set session("username")=nothing
or
session.remove("username")


Isn't I already release it with a null value?

shabbir 17Feb2007 15:22

Re: Clear session
 
Session.Remove actually removes the key from the session collection, whereas setting the key = nothing, essentially does the same, but the key still exists in the collection. Performance wise, just setting the key value = nothing will be faster, as there really isn't a reason to remove the key, especially if later you may just add it back.


All times are GMT +5.5. The time now is 16:59.