locked
Session variable cleared in ASP.NET web page RRS feed

  • Question

  • User697796339 posted

    I used session variable to store some value in ASP web page. I found that for some of my clients(1%), session variable was cleared during post back.

    What might be the reason for session variable to clear? Is there a way to avoid it?

    Sample code:

    If Page.IsPostBack = False Then
        Session("poststring") = "test string"
    Else
        TestVariable = Session("poststring")
    End If
    Saturday, May 5, 2018 8:07 AM

Answers

  • User753101303 posted

    Hi,

    More likely they disabled even non persistent cookies ?

    If you can you could use the session as a cache and reload data as needed. If it is absoluty required you could test for this and show some message.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, May 5, 2018 8:14 AM

All replies

  • User753101303 posted

    Hi,

    More likely they disabled even non persistent cookies ?

    If you can you could use the session as a cache and reload data as needed. If it is absoluty required you could test for this and show some message.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, May 5, 2018 8:14 AM
  • User697796339 posted

    Hi,

    More likely they disabled even non persistent cookies ?

    If you can you could use the session as a cache and reload data as needed. If it is absoluty required you could test for this and show some message.

    Thank you for the reply. My client had his cookie disabled in the browser.

    Monday, May 7, 2018 12:45 PM