Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

releasing session variables

Hi,

I have a bunch of session variables that I want to set, use, then release.
Is this possible? I know I can abandon a users session, but I want to abandon
individual session variables. Example:

Session("UserEmail") = "bla@bla.com"
Server.Execute("email.asp")
Session("UserEmail").clear

I'm using a lot session variables to pass data between forms, and once I'm
done with them, I want to release any memory associated with their usage.

Thanks!
[510 byte] By [Matt Markus] at [2007-11-9 17:50:43]
# 1 Re: releasing session variables
Set them to an empty string.

"Matt Markus" <MattMarkus@MSNHealth.com> wrote in message
news:3eee1ccc$1@tnews.web.dev-archive.com...
>
> Hi,
>
> I have a bunch of session variables that I want to set, use, then release.
> Is this possible? I know I can abandon a users session, but I want to
abandon
> individual session variables. Example:
>
> Session("UserEmail") = "bla@bla.com"
> Server.Execute("email.asp")
> Session("UserEmail").clear
>
> I'm using a lot session variables to pass data between forms, and once I'm
> done with them, I want to release any memory associated with their usage.
>
> Thanks!
Russell Jones at 2007-11-11 23:16:44 >
# 2 Re: releasing session variables
That would be just changing the value of the variable. I want to make the
session variable non-existent, gone, zilch, zap. I don't think setting it
to "" is going to release the resources it's consuming.

Matt
"Russell Jones" <arj1@nospam.northstate.net> wrote:
>Set them to an empty string.
>
>"Matt Markus" <MattMarkus@MSNHealth.com> wrote in message
>news:3eee1ccc$1@tnews.web.dev-archive.com...
>>
>> Hi,
>>
>> I have a bunch of session variables that I want to set, use, then release.
>> Is this possible? I know I can abandon a users session, but I want to
>abandon
>> individual session variables. Example:
>>
>> Session("UserEmail") = "bla@bla.com"
>> Server.Execute("email.asp")
>> Session("UserEmail").clear
>>
>> I'm using a lot session variables to pass data between forms, and once
I'm
>> done with them, I want to release any memory associated with their usage.
>>
>> Thanks!
>
>
Matt Markus at 2007-11-11 23:17:50 >
# 3 Re: releasing session variables
See the Session.Contents.Remove method.

"Matt Markus" <MattMarkus@MSNHealth.com> wrote in message
news:3eee3028$1@tnews.web.dev-archive.com...
>
> That would be just changing the value of the variable. I want to make the
> session variable non-existent, gone, zilch, zap. I don't think setting it
> to "" is going to release the resources it's consuming.
>
> Matt
> "Russell Jones" <arj1@nospam.northstate.net> wrote:
> >Set them to an empty string.
> >
> >"Matt Markus" <MattMarkus@MSNHealth.com> wrote in message
> >news:3eee1ccc$1@tnews.web.dev-archive.com...
> >>
> >> Hi,
> >>
> >> I have a bunch of session variables that I want to set, use, then
release.
> >> Is this possible? I know I can abandon a users session, but I want to
> >abandon
> >> individual session variables. Example:
> >>
> >> Session("UserEmail") = "bla@bla.com"
> >> Server.Execute("email.asp")
> >> Session("UserEmail").clear
> >>
> >> I'm using a lot session variables to pass data between forms, and once
> I'm
> >> done with them, I want to release any memory associated with their
usage.
> >>
> >> Thanks!
> >
> >
>
Russell Jones at 2007-11-11 23:18:44 >