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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:31:32+00:00 2026-05-31T21:31:32+00:00

I was playing around with forms authentication and I noticed a problem if the

  • 0

I was playing around with forms authentication and I noticed a problem if the user closes their browser instead of clicking the signout button on the website.

If a user shuts down the browser the forms auth cookie still exists when the load it back up even though it is a session only cookie and isn’t persisted. In the code behind in my masterpage I have the following.

Masterpage Code behind

  protected void Page_Init(object sender, EventArgs e)
    {        
        // if authenticated, initialize session
        if (Request.IsAuthenticated)
        {            
            // set stuff
        }        
    }

When I debug through it the first time it hits Request.IsAuthenticated it is false, then it hits it again and it is true. The problem is in the front-end page I have some checks to see if the user is authenticated and it is false when it evaluates those conditions.

Masterpage Front-end

 <% if (Request.IsAuthenticated) { %>
       <li>Admin Page</li>
 <% } %>

Setting Auth Cookie

  FormsAuthentication.SetAuthCookie(username, false);

web.Config

   <authentication mode="Forms">
      <forms 
          loginUrl="/"
          name="ASPXFORMSAUTH" 
          timeout="360"         
      />           
    </authentication>

Summary

  1. The forms auth cookie persists when a user just shuts / closes the
    browser down even though it is not a persistent cookie
  2. If a user has an existing forms auth cookie when they load up the
    site the Request.IsAuthenticated check evaluates to false on the
    first hit in the debugger and then true on the second. The front-end
    page obviously checks these things on the first hit because they
    evaluate to false.
  • 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-31T21:31:33+00:00Added an answer on May 31, 2026 at 9:31 pm

    Figured it out.

    Appears to be a Firefox issue. Firefox use to allow users to save their tabs, but removed that feature. Saving tabs also saved any session cookies associated with tabs.

    The setting in the about:config is

    browser.showQuitWarning
    

    I am on firefox 11, so this should have been disabled by default, but my config somehow got corrupted and I had to reset it by using safe mode and restoring default settings. Now it works

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

Sidebar

Related Questions

I am playing around with data binding and noticed that the Binding Format is
I'm playing around with authentication and authorization to prepare for some task. I've created
I'm currently playing around with HTML_QuickForm for generating forms in PHP. It seems kind
I have been playing around with webkit.net in a c# win forms project, and
I'm playing around with Project Euler's Problem 220 , and I'm a little confused
I'm playing around with the physics login form from Doug Mccune's blog I'm trying
Playing around with Python - tkInter - Entry widget - when I use validatecommand
Playing around with MongoDB and NoRM in .NET. Thing that confused me - there
been playing around with ResolveClientUrl(~/Confirmation.aspx) and other methods.. I am tryin go get the
I playing around with the Twitter API for my BlackBerry application. Is there any

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.