Clear session

Go4Expert Member
17Feb2007,14:36   #1
tsalexey544's Avatar
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?
Go4Expert Founder
17Feb2007,15:22   #2
shabbir's Avatar
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.