Session variables corruption in .NET

Posted on 2009-02-16
Last Modified: 2012-05-06
Is it really correct that session variable are not to be trusted in????
I have a web app (VB.NET) deployd on a web server on the internet that seems to get the session variables corrupted (blanked out) sometimes for no good reason as I can see. There is not a timeout situation! And it happens now and then with no reasonable explanation...
I have read some articles telling that session variables may corrupt if there is a lot of users connecting to the same app at the same time. Could it be??? Isn't the session variables connected to the spesific session??
What is the point of session variables if I cannot trust in them??? What alternatives do I have???
Question by:Joar
    LVL 4

    Assisted Solution


    Author Comment

    Just a question while I am studying your link: Shoudn't 2 browser accessing the same app create 2 sessions?
    LVL 4

    Expert Comment

    If you open application in 2 seperate windows then it will create 2 sessions. But if open another browser from first browser then you will have same session on both the browsers.

    Author Comment

    So there should be no session variable conflicts at any time as long as different users open the same application from different PC's???
    Then I feel that the link (which I neeed some time to understand...) is discussing another situation than my clients are into.
    Can it be that some error handling in my app is not taken care of and thus causing destruction if the session variables?

    Accepted Solution

    To me this insertion in the web.config seemed to solve the error situation:
        <sessionState mode="StateServer"

    I was running sessionState mode="InProc"

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

          Install BugTracker on Windows 2008 server Step 1:  Install windows 2008 server 32 bit OS and configure IIS. Step 2:  Install SQL server ( SQL server 2005 or SQL server 2005 Express edition. The installer for 2008  version isn’t very f…
    New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa… provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
    Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now