locked
How to close a particular session? RRS feed

  • Question

  • User246057125 posted

    I want to close a particular close or delete it permanently. I looked into Session.Clear, but probably it clears all the sessions. I want to abandon a particular session.

    Monday, November 21, 2011 9:50 AM

Answers

  • User-1300795247 posted

    Here's a good link that should clear up the different methods for you.

     

    http://abhijitjana.net/2011/06/04/asp-net-internals-clearing-asp-net-session-variables-a-in-depth-look/

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 21, 2011 9:56 AM
  • User-1028151323 posted

    Session("whatever") = nothing

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 21, 2011 10:49 AM
  • User-519136805 posted

    Hi , Just assign null to the session variable to which you want to abandon.

    Session["MySessionVariable"] = null;

    Hope this will help !!!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 22, 2011 4:06 AM
  • User2089610046 posted

    why not using

    session.Remove("ID"); ??

    Session["id"]=null;

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 22, 2011 4:21 AM
  • User-1947958263 posted

    session["session_id"].abandon;

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 22, 2011 7:05 AM
  • User-110526006 posted

    Hi

    Hope it is helpful 4 U

    Session["SessionVariable"] = null;

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 22, 2011 7:44 AM

All replies

  • User-1300795247 posted

    Here's a good link that should clear up the different methods for you.

     

    http://abhijitjana.net/2011/06/04/asp-net-internals-clearing-asp-net-session-variables-a-in-depth-look/

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 21, 2011 9:56 AM
  • User-1028151323 posted

    Session("whatever") = nothing

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 21, 2011 10:49 AM
  • User-519136805 posted

    Hi , Just assign null to the session variable to which you want to abandon.

    Session["MySessionVariable"] = null;

    Hope this will help !!!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 22, 2011 4:06 AM
  • User2089610046 posted

    why not using

    session.Remove("ID"); ??

    Session["id"]=null;

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 22, 2011 4:21 AM
  • User-1947958263 posted

    session["session_id"].abandon;

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 22, 2011 7:05 AM
  • User-110526006 posted

    Hi

    Hope it is helpful 4 U

    Session["SessionVariable"] = null;

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 22, 2011 7:44 AM