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

  • Question

  • 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

    • Moved by Reed KimbleMVP Sunday, May 6, 2018 1:58 PM asp.net in vb language
    Saturday, May 5, 2018 5:48 AM

Answers

  • A session variable residence on the server. It can be cleared if the time to post back takes to long. 

    Be aware that sometimes clients open a new page instead using the same it looks then if the session is cleared. 


    Success
    Cor

    Saturday, May 5, 2018 7:23 AM
  • ASAP.NET issues can be discussed at the ASP.NET forum.

    http://forums.asp.net/

    If you are talking classic ASP, then you'll need to find a forum for that by using Bing or Google.

    Saturday, May 5, 2018 7:49 AM

All replies

  • A session variable residence on the server. It can be cleared if the time to post back takes to long. 

    Be aware that sometimes clients open a new page instead using the same it looks then if the session is cleared. 


    Success
    Cor

    Saturday, May 5, 2018 7:23 AM
  • ASAP.NET issues can be discussed at the ASP.NET forum.

    http://forums.asp.net/

    If you are talking classic ASP, then you'll need to find a forum for that by using Bing or Google.

    Saturday, May 5, 2018 7:49 AM