Multiple sessions, how to kill only one

Discussion in 'ASP General' started by Mangler, Oct 10, 2006.

  1. Mangler

    Mangler Guest

    I have 2 sessions that get created. One when the user logs in called
    "uname" and another called "idrma" when that user choses to begin a
    repair request. I know <%session.abandon%> will kill both sessions,
    how to I only target one?
    Mangler, Oct 10, 2006
    #1
    1. Advertising

  2. Mangler

    Mike Brind Guest

    "Mangler" <> wrote in message
    news:...
    >I have 2 sessions that get created. One when the user logs in called
    > "uname" and another called "idrma" when that user choses to begin a
    > repair request. I know <%session.abandon%> will kill both sessions,
    > how to I only target one?
    >


    You mean two session VARIABLES.

    To create a session variable: Session("Uname") = "Some value"

    To "kill" it: Session("Uname") = ""

    --
    Mike Brind
    Mike Brind, Oct 10, 2006
    #2
    1. Advertising

  3. Mangler

    Mangler Guest

    <% Session.Contents.Remove("uname") %>

    Would this work the same?


    Mike Brind wrote:
    > "Mangler" <> wrote in message
    > news:...
    > >I have 2 sessions that get created. One when the user logs in called
    > > "uname" and another called "idrma" when that user choses to begin a
    > > repair request. I know <%session.abandon%> will kill both sessions,
    > > how to I only target one?
    > >

    >
    > You mean two session VARIABLES.
    >
    > To create a session variable: Session("Uname") = "Some value"
    >
    > To "kill" it: Session("Uname") = ""
    >
    > --
    > Mike Brind
    Mangler, Oct 10, 2006
    #3
  4. Mangler

    Mike Brind Guest

    Yes. No. My method retains the session variable, but sets its value to an
    empty string. Yours removes it altogether from the collection.

    You can test the content/value of your session variables like this:

    For each x in Session.Contents
    Response.Write x & ": " & Session.Contents(x) & "<br />"
    Next

    --
    Mike Brind

    "Mangler" <> wrote in message
    news:...
    > <% Session.Contents.Remove("uname") %>
    >
    > Would this work the same?
    >
    >
    > Mike Brind wrote:
    >> "Mangler" <> wrote in message
    >> news:...
    >> >I have 2 sessions that get created. One when the user logs in called
    >> > "uname" and another called "idrma" when that user choses to begin a
    >> > repair request. I know <%session.abandon%> will kill both sessions,
    >> > how to I only target one?
    >> >

    >>
    >> You mean two session VARIABLES.
    >>
    >> To create a session variable: Session("Uname") = "Some value"
    >>
    >> To "kill" it: Session("Uname") = ""
    >>
    >> --
    >> Mike Brind

    >
    Mike Brind, Oct 10, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken Cox [Microsoft MVP]

    Re: Relationship between IIS Sessions and ASP.NET Sessions?

    Ken Cox [Microsoft MVP], Aug 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    5,348
    Luther Miller
    Aug 8, 2003
  2. D. Shane Fowlkes
    Replies:
    3
    Views:
    614
    S. Justin Gengo
    Feb 24, 2004
  3. Andreas Klemt
    Replies:
    1
    Views:
    3,955
    Brock Allen
    Apr 15, 2005
  4. Fabrice
    Replies:
    2
    Views:
    8,465
    Marina
    Sep 6, 2005
  5. =?Utf-8?B?QkxpVFpXaU5H?=

    Exceptions kill Sessions?

    =?Utf-8?B?QkxpVFpXaU5H?=, Dec 12, 2005, in forum: ASP .Net
    Replies:
    9
    Views:
    670
    John Timney \( MVP \)
    Dec 14, 2005
Loading...

Share This Page