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

  • SEARCH
  • Home
  • 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 467093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:32:46+00:00 2026-05-12T23:32:46+00:00

In my application I save some data related to the users sessions in the

  • 0

In my application I save some data related to the users sessions in the database. When the user logoff I cleanup all his session data from the database. So far, so good.

But, when IIS is restarted, all the active sessions are invalidated without the chance to gracefully cleanup.

So, I need to identify when IIS is restarted to solve this situation.

  • 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-12T23:32:46+00:00Added an answer on May 12, 2026 at 11:32 pm

    I would just put something int the application_start event in the global.asax

    http://www.codetoad.com/asp.net_globalasax.asp

    Your app has restarted for some reason, and according to your description it’ll have to clean all the sessions out of the db regardless if it is from IIS restarting, or the app pool getting recycled etc.

    You can’t trust your application to set a flag that IIS has signaled a restart in your application_end event, because there are times when it won’t fire. For example what happens if the server crashes, or if IIS gets killed outside of it’s control (taskkill).

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

Sidebar

Related Questions

My Flex application does a remote call to weborb to save some data from
For part of a web application the user needs to import some data from
I want to save some custom data into application configuration file and I need
I'm trying to create core data application. Some times when trying to save data,
My application uses MS access database to save some sensitive information. Though that information
I need to save some data in my application, when the application terminates and
I'm developing a desktop application with .NET. I'd like to save some data into
I'm developing a multi-user application which uses a (postgresql-)database to store its data. I
We are developing an application in android,We have to save some lists and data
Using CakePHP 1.3 I'm trying to save some data to a MySQL database. The

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.