locked
how to clear sessionID (or get a new sessionID) RRS feed

  • Question

  • User-1025832227 posted

    i am using the Session.SessionID to identify my shoppingcart. the problem is when the transaction is complete if the user clicks back and tries to order again it uses the same sessionID and inserts a duplicate. i tried Session.Abandon and Session.Clear but it still is using the same SessionID. can i force a new one or will it only work if the browser window is closed and re-opened? 

    Sunday, July 15, 2007 12:42 PM

Answers

  • User1001868398 posted

    You doing right, however the session won't get a new ID until the page goes out of scope, you need to Redirect to another page that will receive the new Session.

    Of course you can always delete the history in javascript so the user cannot go back

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, July 15, 2007 2:17 PM
  • User1730632263 posted

    I think getting new SessionID is not possible. But Still you can try following steps...

    1. Session.Abandon()
    2. Remove the SessionID from the Cookies...as that contains SessionID,
    3. and use Response.Redirect to your index page (rather than Server.transfer) ; So that new Session can be created.

    Please note that, I am not sure about this solution. but Still you should try for that 

     

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 16, 2007 7:01 AM

All replies

  • User1001868398 posted

    You doing right, however the session won't get a new ID until the page goes out of scope, you need to Redirect to another page that will receive the new Session.

    Of course you can always delete the history in javascript so the user cannot go back

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, July 15, 2007 2:17 PM
  • User1730632263 posted

    I think getting new SessionID is not possible. But Still you can try following steps...

    1. Session.Abandon()
    2. Remove the SessionID from the Cookies...as that contains SessionID,
    3. and use Response.Redirect to your index page (rather than Server.transfer) ; So that new Session can be created.

    Please note that, I am not sure about this solution. but Still you should try for that 

     

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 16, 2007 7:01 AM