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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:09:36+00:00 2026-05-18T03:09:36+00:00

Using ASP.NET 2.0, with forms authentication. Just for a test, I configured the roles

  • 0

Using ASP.NET 2.0, with forms authentication.
Just for a test, I configured the roles cookie in web.config like this :

<roleManager enabled="true" cacheRolesInCookie="true" cookieName=".ASPXROLES" cookieTimeout="2"></roleManager>

I wanted to see what would happen when the cached role cookie expired.
Using Fiddler, after 2 minutes had elapsed, I could see that the raw value of the role cookie had changed.

I was expecting that on expiry, that ASP.NET would simply re-read the roles information from the database, and repopulate the cookie with the same value. So my question is, why would the raw value of the cookie change after expiry ? The cookie value is not human-readable (base 64 encoded and/or encrypted ?), so I can’t tell if the information in it is the same, although the application still seems to work fine.

EDIT :

It looks like each time the roles are encrypted and cached in the cookie, it gets a different raw value.

e.g. if you run the following code :

    RolePrincipal rp = (RolePrincipal) User;
    string str = rp.ToEncryptedTicket();
    Label1.Text = str;

You get a different value each time.
So the behavior seems normal.

  • 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-18T03:09:37+00:00Added an answer on May 18, 2026 at 3:09 am

    Well the aspxroles cookie only pertains to role queries on the user. Unless you’re doing things with the roles that would cause it to function differently (web.config auth?) then you’re not going to see anything by expiring the cookie.

    Can you share your web.config and basic pages that you’re using to test this?

    Have you tried that particular configuration to see what changes after the expiration?

    <location path="img/logo.png">
        <system.web>
            <authorization>
                <deny users="?"/>
                <allow roles="CanSeeLogo"/>
            </authorization>
        </system.web>
    </location>
    

    Based on the question edit:

    In my web.config under <configuration><system.web> I have this key:

    <machineKey decryption="AES" decryptionKey="{64bits random hex}" validation="SHA1" validationKey="{128 bits random hex}"/>
    

    I’m curious if you set that “manually” if you’ll have a constantly changing encrypted string. Also, this is set by default in your C:\Windows\Microsoft.Net\Framework\etc folders, but you can redefine it (obviously) in your web.config to override it per application. This also allows you to share the same cookie cross-app within your domain.

    Link to generate random hex strings

    https://www.grc.com/passwords.htm

    concat the first result from two page refreshes for the second one. Removing the web.config key later doesn’t impact your app negatively (of course it wouldn’t)

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

Sidebar

Related Questions

I'm using forms authentication on a very small ASP.NET web app (Web Forms) in
How exactly can one implement a Log off function when using ASP.NET Forms Authentication
I'm writing an app using asp.net-mvc deploying to iis6. I'm using forms authentication. Usually
I'm using the ASP.NET Login Controls and Forms Authentication for membership/credentials for an ASP.NET
I'm using the ASP.NET Login Controls and Forms Authentication for membership/credentials for an ASP.NET
I am testing the UI of my ASP.Net Web Forms app using NUnit/Watin. I
Using web forms I know that you can only have one ASP.NET form on
I've been a longtime ASP.NET developer in the web forms model, and am using
I'm in the middle of building a pretty big site using asp.net (forms if
Most of my programming experience has either been using forms (Windows Forms, or ASP.NET)

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.