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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:21:49+00:00 2026-05-13T15:21:49+00:00

I just got pinged on another post because my application doesn’t keep the user

  • 0

I just got pinged on another post because my application doesn’t keep the user logged in after an iisreset.

How do I solve an AntiForgeryToken exception that occurs after an iisreset in my ASP.Net MVC app?

I have to say I agree with the commenter that it is an artificial restriction.

From what I’ve read about Forms Authentication it appears that the logged in session information is all stored in memory and when the server is restarted you lose that information.

What I’d like to do is to simply be able to store that information somewhere, ideally in a database so that I can continue on with my sessions. I can’t seem to find any way to extend it to do that though. Am I missing something? Have I misunderstood how it’s working?

I realise that this is a ‘free’ piece of kit they’re giving us but I’d rather not roll my own because there’s a lot they got right and that I have the potential to screw up with my own solution.

Edit: Note this doesn’t have anything to do with Session state. As far as I know I’m not using session state at all unless something under me in the framework uses it internally.

I realise that the cookies are used by the authentication but they haven’t expired. I’m still getting bounced to the login page after an iisreset though.

  • 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-13T15:21:50+00:00Added an answer on May 13, 2026 at 3:21 pm

    Sounds like your problem here is that the <machineKey /> validationKey and decryptionKey attributes are set to AutoGenerate which means they’re changing across IIS resets.

    This means that encrypted persistent forms authentication cookies will no longer be valid the next they’re presented.

    You can fix this by manually configuring a fixed validationKey and decryptionKey. To do this take a look at this article:

    How To: Configure MachineKey in ASP.NET 2.0

    Scroll down to the section on “Web Farm Deployment Considerations” and Generate Cryptographically Random Keys.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer In python it helps to think of declaring variables as… May 13, 2026 at 3:22 pm
  • Editorial Team
    Editorial Team added an answer The private field components is used to track disposable components… May 13, 2026 at 3:22 pm
  • Editorial Team
    Editorial Team added an answer That doesn't seem terribly out of line. If it's a… May 13, 2026 at 3:22 pm

Related Questions

I've got a simple php script to ping some of my domains using file_get_contents(),
I just got Delphi 2009 and have previously read some articles about modifications that
I just got a dedicated server from a hosting company, and for some reason,
I just got through manually removing the bin\ and obj\ folders from around 30
I just got a shiny, brand-new Debian server handed to me by our Systems

Trending Tags

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

Top Members

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.