object in session question

Discussion in 'ASP .Net' started by =?Utf-8?B?Sko=?=, Jan 13, 2005.

  1. Hi,

    I assigned a class to a session and after its use during the session I
    want to null it out of the session or reset it by killing the object in the
    session and creating a new one. Any ideas on how to do this? What's the best
    method to do this?

    Thanks,

    JJ
     
    =?Utf-8?B?Sko=?=, Jan 13, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?Sko=?=

    Curt_C [MVP] Guest

    the garbage collection should do it automatically. If its in the Session
    object it will "go away" when the session terminates

    --
    Curt Christianson
    Site & Scripts: http://www.Darkfalz.com
    Blog: http://blog.Darkfalz.com


    "JJ" <> wrote in message
    news:...
    > Hi,
    >
    > I assigned a class to a session and after its use during the session I
    > want to null it out of the session or reset it by killing the object in
    > the
    > session and creating a new one. Any ideas on how to do this? What's the
    > best
    > method to do this?
    >
    > Thanks,
    >
    > JJ
     
    Curt_C [MVP], Jan 13, 2005
    #2
    1. Advertising

  3. Hi,

    Call the Remove method of the HttpSessionState class to remove the item from
    Session, and then dispose it.

    regards'
    Joyjit

    "JJ" <> wrote in message
    news:...
    > Hi,
    >
    > I assigned a class to a session and after its use during the session I
    > want to null it out of the session or reset it by killing the object in

    the
    > session and creating a new one. Any ideas on how to do this? What's the

    best
    > method to do this?
    >
    > Thanks,
    >
    > JJ
     
    Joyjit Mukherjee, Jan 13, 2005
    #3
  4. Okay, you want to "start a new one," which means you want to replace the
    current instance with another instance, correct? If so, just assign the new
    instance to the Session variable. Once this is done, the old instance has no
    references, and Garbage Collection will clean it up.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Neither a follower nor a lender be.

    "JJ" <> wrote in message
    news:...
    > Hi,
    >
    > I assigned a class to a session and after its use during the session I
    > want to null it out of the session or reset it by killing the object in
    > the
    > session and creating a new one. Any ideas on how to do this? What's the
    > best
    > method to do this?
    >
    > Thanks,
    >
    > JJ
     
    Kevin Spencer, Jan 13, 2005
    #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. Jeff Smythe
    Replies:
    3
    Views:
    1,256
    Jeff Smythe
    Jan 2, 2004
  2. Boban Dragojlovic
    Replies:
    2
    Views:
    475
    Patrice
    Apr 19, 2004
  3. momo898
    Replies:
    2
    Views:
    494
    bruce barker \(sqlwork.com\)
    Oct 12, 2006
  4. =?Utf-8?B?Um9iSEs=?=
    Replies:
    4
    Views:
    5,292
    =?Utf-8?B?Um9iSEs=?=
    Apr 11, 2007
  5. Jazzis
    Replies:
    2
    Views:
    252
    Jazzis
    Sep 23, 2003
Loading...

Share This Page