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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:52:30+00:00 2026-06-06T22:52:30+00:00

While deveoping a site (using Forms authentication and InProc sessionstate) a frequently run into

  • 0

While deveoping a site (using Forms authentication and InProc sessionstate) a frequently run into a scenario where I lose the variables stored in Session (such as Session[“myVar”]), but my auth-session remains valid.

This results in some wierd behavior on my site.

Why is this happening and what can I do to prevent diffrent lifecycles for my auth and my session variables?

  • 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-06-06T22:52:31+00:00Added an answer on June 6, 2026 at 10:52 pm

    In Asp.Net a Session and “Being logged in” are not the same thing.

    Both are (usually) controlled by cookies, but the cookies are separate.

    To control how long a Session is kept alive, please see answer by Jonas T.

    To control how long a user remains logged in, you can use the timeOut on the <forms ... /> element:

    <system.web>
        <authentication mode="Forms">
            <forms loginUrl="~/Account/Login.aspx" timeout="120" slidingExpiration="true"/>
        </authentication>
        ...
    </system.web>
    

    To get rid of your problem you should make sure that the session timeout is at least as long as the forms authentication timeout.

    If you are allowing persisted cookies in forms authentication (“Remember me”), then there are no gurantees. In that case you just have to set the session timeout to “long enough” according to some criteria/specification.

    Edit: Also check the settings on your application pool (under IIS) where the site is deployed. And specifically check what the “Idle Time-out” is. If this is set low (default value is 20 minutes I think), then IIS will shut down the application pool if no request have come in during that time. That (of course) terminates whatever in-proc sessions existed.

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

Sidebar

Related Questions

I'm using Aptana as my IDE while developing a Symfony (1.4) site. I have
I run into this problem constantly while developing AJAX applications. Let's say I want
I am using SVN while developing a WordPress site. Now I want to upload
Just wondering whats the best way to test Python CGI while developing a site?
This has been frustrating me for a while now. I started developing a site
While developing an application using gwt in ecliplse crashed. Now the server is running
While developing a firefox extension, I create a wizard window from overlay.js using: this.wizard
I have, for a while now been using a reset.css file to reset everything
I am developing a site using ASP.NET 2.0. AjaxToolKit's ModalPopupExtender is being used to
While developing a site which I can't link to directly, I've found a following

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.