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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:48:09+00:00 2026-05-19T01:48:09+00:00

I have a Asp Mvc 2 site using forms authentication. When I run it

  • 0

I have a Asp Mvc 2 site using forms authentication. When I run it locally I can log in and stay logged in indefinitely.

However when I put it on the server I seem to only stay logged in for a few minutes and then seems to be logged out. I have looked at the cookies and there are 2 which seem relevant:

.ASPXAUTH which is a session cookie
.ASPXANONYMOUS which expires in 3 months.

When I refresh the page the cookies stay the same until I get logged out, when I seem to get a new .ASPXANONYMOUS cookie, but the .ASPXAUTH seems to be the same.

It seems that I might be able to stay logged in until I do something after a certain amount of time. If I submit a form as soon as I am logged in then it works ok, but if I keep submitting data again and again then after a minute or so, one of the submits will happen as a logged out user and not as the user who was logged in, which all the other submits worked as.

What might cause this behaviour and how can I track down what is different & change it so that I can stay logged in indefinitely?

EDIT,

its a single server, but after some more investigation and searching the likely candidate seems to be that I am using more than 100mb on the server and the application pool is getting recycled. I suppose now i need to know

  • How can I check how much memory I’m using.
  • What advice there is to reduce that.
  • 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-19T01:48:10+00:00Added an answer on May 19, 2026 at 1:48 am

    Could it be that the ASP.NET application is being re-cycled or shutdown (e.g. due to idle timeout, or newly built/changed assemblies)?

    When an ASP.NET web application starts up it will, by default, generate encryption keys for view state and session cookies. This will invalidate any such data originally served from an earlier run of the application (or from a different system).

    To have sessions survive ASP.NET application cycles (and multi-server farms) you can specify the keys in your web.config:

    <system.web>
      ...
      <machineKey
        decryption="AES"
        validation="SHA1"
        decryptionKey="..."
        validationKey="..."
      />
    

    where decryptionKey and validationKey are hex strings of length depending on the algorithm (with AES: 64 digits and SHA1: 128, for other algorithms check MSDN).

    These keys should be cryptographically generated, and .NET has the types to do this which can be used from PowerShell:

    $rng = New-Object "System.Security.Cryptography.RNGCryptoServiceProvider"
    $bytes = [Array]::CreateInstance([byte], 16)
    $rng.GetBytes($bytes)
    $bytes | ForEach-Object -begin { $s = "" } -process { $s = $s + ("{0:X2}" -f $_) } -end { $s}
    

    For AES use the above array length, for SHA1 use a length of 64.

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

Sidebar

Related Questions

I have a ASP.NET MVC site that is locked down using Forms Authentication. The
I've been developing a site using ASP.NET MVC, and have decided to use the
I am currently creating an e-commerce site using C# ASP.NET MVC and have just
I have an Asp.net Mvc site where I want to give a separate access
I am building an Asp.net MVC site where I have a fast dedicated server
I have an ASP.NET MVC (Beta 1) website that I'm using themes with. When
I am trying to create a custom authentication scheme in ASP.NET MVC using form
I'm using OpenId in my ASP.NET MVC application. Works great :) Once i have
I have put together a small ASP.NET MVC 2 site that does some very
I am using ASP.NET MVC2 and have a problem. After Log off I manually

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.