Clear session from aspstate database on logout button click RRS feed

  • Question

  • User-16010594 posted

    hi all,

    In my asp.net3.5 web application

    i hv set  <sessionState mode="SQLServer" >.When i login with username-pwd,

    it creates row dbo.ASPStateTempSessions for current session.

    This row will automatically get deleted on timeout happens.

    But want to delete the row when user clik on logout button.

    Plz help me how can i do it.

    thnx in advance.

    Monday, January 21, 2013 2:54 AM


All replies

  • User1137674169 posted

    Put this code in the logout button

    To remove specific session variable


    To clear all session variables 

    Tuesday, January 22, 2013 1:04 AM
  • User1849925139 posted


    Please set slidingExpiration="true"  in <Form slidingExpiration="true" > tag.


    Santosh Gada

    If it heps mark as answered

    Tuesday, January 22, 2013 2:12 AM
  • User-16010594 posted

    Thanx a lot both of you.

    I tried but not helping me out.

    Also i m sorry that i hv forgot to mention that the I hv to login into one website and using same login i hv to auto loign into the links of website given in the first website.So, as i m saving session in sql server when i try to logout from first website it allows me but not from second website.

    It is a senario of 'Single sign on for website in same domain'


    after loging into above link

    I can automatically get loggedin into


    hope u all understand the senario.

    Tuesday, January 22, 2013 2:33 AM
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 24, 2013 8:33 AM