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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:24:06+00:00 2026-05-28T06:24:06+00:00

I am getting 403 when a user accidentally closes their browser without logging out

  • 0

I am getting 403 when a user accidentally closes their browser without logging out and tries again to open the url.

When they check back, website throws 403. To temporarily resolve the issue I clean out all the cookies and the access is back on.

Error:
403 – Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied.

Details to troubleshoot:
Web.Config file

  <forms loginUrl="index.aspx" 
         protection="All" path="/" 
         timeout="300" 
         name="AppNameCookie" 
         slidingExpiration="true" 
         defaultUrl="index.aspx" 
         cookieless="UseCookies" 
         enableCrossAppRedirects="false" 
         requireSSL="false"/>

Code to authenticate users

                ' Create the cookie that contains the forms authentication ticket                
                Dim authCookie As HttpCookie = FormsAuthentication.GetAuthCookie(sUserName, False)

                'HttpOnly cookie means it is not accessible by the client through ECMAScript.
                authCookie.HttpOnly = True

                authCookie.Expires = Now.AddMinutes(300)


                ' Get the FormsAuthenticationTicket out of the encrypted cookie                
                Dim ticket As FormsAuthenticationTicket = FormsAuthentication.Decrypt(authCookie.Value)

                ' Create a new FormsAuthenticationTicket that includes our custom User Data                
                Dim newTicket As FormsAuthenticationTicket = New FormsAuthenticationTicket(ticket.Version, ticket.Name, ticket.IssueDate, ticket.Expiration, ticket.IsPersistent, userDataString)

                ' Update the authCookie's Value to use the encrypted version of newTicket                
                authCookie.Value = FormsAuthentication.Encrypt(newTicket)

                ' Manually add the authCookie to the Cookies collection                
                Response.Cookies.Add(authCookie)
                ' Determine redirect URL and send user there  

I think there is an issue with the cookies but I am unable to figure the root cause for this issue.

UPDATE: I found how to duplicate this issue

Login as a user and close the browser without logging out.
Try to open the home page and it throws error.

  • 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-28T06:24:06+00:00Added an answer on May 28, 2026 at 6:24 am

    Issue has been resolved.

    The conflict was with the AuthCookie in the login page and the following line was causing the problem.

    authCookie.HttpOnly = True
    authCookie.Expires = Now.AddMinutes(120)
    Dim ticket As FormsAuthenticationTicket = FormsAuthentication.Decrypt(authCookie.Value)
    Dim newTicket As FormsAuthenticationTicket = New FormsAuthenticationTicket(ticket.Version, ticket.Name, ticket.IssueDate, ticket.Expiration, False, userDataString)
    authCookie.Value = FormsAuthentication.Encrypt(newTicket)
    

    Replaced with the following lines they work fine.

    Dim asx As New FormsAuthenticationTicket(sdata, False, 60)
    Now encrypt the ticket.
    Dim encryptedTicket As String = FormsAuthentication.Encrypt(asx)
    Dim authCookie As New HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket)
    Response.Cookies.Add(authCookie)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting 403 Errors from Apache when I send too many, 12, synchronous
Getting the subdomain from a URL sounds easy at first. http://www.domain.example Scan for the
I am getting this missing artifact message for javax.transaction:jta:jar:1.0.1B as 403 Forbidden Multiple annotations
For some reason I cannot get the error logging to work, I'm getting the
I am getting 403 error when publish an Asp.Net MVC app to IIS6. Any
For face book and Google Plus I am getting 407 and 403 result code.
I need to capture user's X.509 certificates from their cards and map to a
I'm getting a redirect loop on a Drupal 7 install. Whenever a non-admin user
In Android Emulator i am getting below Logcat Error: 03-11 04:44:56.663: ERROR/AndroidRuntime(403): java.lang.RuntimeException: Unable
When I'm accessing web service from jquery, I'm getting the 403 forbidden error.. I

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.