Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1027113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:11:25+00:00 2026-05-16T12:11:25+00:00

I have an ASP.net application where Users aren’t able to successfully complete certain actions,

  • 0

I have an ASP.net application where Users aren’t able to successfully complete certain actions, for reasons, I’m assuming, can only be related to losing their session (which is where I maintain their current user information, and how determine whether they are logged in)

I’m at a loss as to why they would lose their session, so my first question is:

What (in general) would cause a user to lose their session in ASP.net?

and since I don’t know when a user loses their session and can’t reproduce it myself:

How can I track when I user loses their session

Below is my sessionState config for reference

<sessionState
           mode="InProc"
           cookieless="false"
           cookieName="My.Site.Com"
           timeout="480"/>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T12:11:26+00:00Added an answer on May 16, 2026 at 12:11 pm

    A number of things can cause session state to mysteriously disappear.

    1. Your sessionState timeout has expired
    2. You update your web.config or other file type that causes your AppDomain to recycle
    3. Your AppPool in IIS recycles
    4. You update your site with a lot of files, and ASP.NET proactively destroys your AppDomain to recompile and preserve memory.

    –

    If you are using IIS 7 or 7.5, here are a few things to look for:

    1. By default, IIS sets AppPools to turn themselves off after a period of inactivity.
    2. By default, IIS sets AppPools to recycle every 1740 minutes (obviously depending on your root configuration, but that’s the default)
    3. In IIS, check out the “Advanced Settings” of your AppPool. In there is a property called “Idle Time-out”. Set that to zero or to a higher number than the default (20).
    4. In IIS, check the “Recycling” settings of your AppPool. Here you can enable or disable your AppPool from recycling. The 2nd page of the wizard is a way to log to the Event Log each type of AppPool shut down.

    If you are using IIS 6, the same settings apply (for the most part but with different ways of getting to them), however getting them to log the recycles is more of a pain. Here is a link to a way to get IIS 6 to log AppPool recycle events:

    http://web.archive.org/web/20100803114054/http://surrealization.com/sample-code/getnotifiedwhenapppoolrecycles/

    –

    If you are updating files on your web app, you should expect all session to be lost. That’s just the nature of the beast. However, you might not expect it to happen multiple times. If you update 15 or more files (aspx, dll, etc), there is a likelyhood that you will have multiple restarts over a period of time as these pages are recompiled by users accessing the site. See these two links:

    http://support.microsoft.com/kb/319947

    http://msdn.microsoft.com/en-us/library/system.web.configuration.compilationsection.numrecompilesbeforeapprestart.aspx

    Setting the numCompilesBeforeAppRestart to a higher number (or manually bouncing your AppPool) will eliminate this issue.

    –

    You can always handle Application_SessionStart and Application_SessionEnd to be notified when a session is created or ended. The HttpSessionState class also has an IsNewSession property you can check on any page request to determine if a new session is created for the active user.

    –

    Finally, if it’s possible in your circumstance, I have used the SQL Server session mode with good success. It’s not recommended if you are storing a large amount of data in it (every request loads and saves the full amount of data from SQL Server) and it can be a pain if you are putting custom objects in it (as they have to be serializable), but it has helped me in a shared hosting scenario where I couldn’t configure my AppPool to not recycle couple hours. In my case, I stored limited information and it had no adverse performance effect. Add to this the fact that an existing user will reuse their SessionID by default and my users never noticed the fact that their in-memory Session was dropped by an AppPool recycle because all their state was stored in SQL Server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 535k
  • Answers 535k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I simply changed my Session_Start to: // If the user… May 17, 2026 at 1:03 am
  • Editorial Team
    Editorial Team added an answer In Your Activity B, create a Handler Handler mHandler =… May 17, 2026 at 1:03 am
  • Editorial Team
    Editorial Team added an answer I'm not sure where your current problem is but by… May 17, 2026 at 1:03 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have an ASP.NET web application that has a fileupload control to allow users
I have an ASP.NET web application, which operates just fine on IE7, IE8, IE8(Compatibility
I have written an ASP.NET MVC application that allows the user to specify their
I've been tasked with adding functionality to an existing ASP.net Form Application. Users are
I have an asp.net application in which I have built few silverlight based pages.
We have an ASP.NET application that's partly in MVC (the rest of it being
I have an ASP.NET web application and I'm thinking about the following: before sending
I have a legacy ASP.NET application in which there are some session/concurrency related issues
Having a weird problem. I'm testing an ASP.NET application I wrote that queries SQL
I am using Windows Authentication in my ASP.NET MVC application and I am prompted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.