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 4603612
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:10:32+00:00 2026-05-22T00:10:32+00:00

I use chrome as debugging browser. When I start my MVC (Razor) website, click

  • 0

I use chrome as debugging browser.

When I start my MVC (Razor) website, click the stop button and the website keeps running in chrome ,while I can make changes in VS … perfect.

But sometimes (due to I don’t know what changes), when I refresh a page, I’m still logged in, but I looses all my session vars.

How can I catch if session vars is cleared, so I can take my users back to login page? (I need a kinde global.asax page_request method.

I do have the .. <forms loginUrl="~/Account/LogOn" timeout="2880" /> … but Im not logged out – only session vars are cleared.

  • 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-22T00:10:33+00:00Added an answer on May 22, 2026 at 12:10 am

    It’s because your login state is persisted in a client cookie. The session state is persisted on the server in memory (or whatever). When your app restarts the session is cleared but the user still has a valid forms authentication token (assuming forms authentication here) on their machine. Forms authentication does’t use session in any way by default.

    So, at the beginning of the request, you can either reload the user session from the database when it’s null (I think this is the preferred approach if possible) or redirect the user to the login screen with a message saying “ooops, sorry we’ve lost your session” (which is not good!)

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

Sidebar

Related Questions

Can you use Html DOM in google chrome extension to... 1) write/Auto fill in
We can use the XPathEvaluator object(in javascript) to do xpath evaluation on Safari,Google Chrome
While debugging python application, I normally use pdb / ipdb's set_trace() function to programmatically
Since I can't use chrome.extension.getURL() on a CSS file, how can I use @font-face
I want to use google chrome as a control. I think Enso does this
Given that Chrome and Safari use webkit has anyone yet found anything that renders
I currently use Chrome/Firefox for my web development. Is there a plugin, or am
I use chrome and Firefox. I love chrome and Firefox. I just thought to
I have a client that wants to use Google Chrome for an internal web
I know it's possible to use a grabbing cursor icon in Chrome (in Gmail,

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.