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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:07:12+00:00 2026-05-25T12:07:12+00:00

I am implementing a Custom Identity class for an ASP.Net 4.0 site with Forms

  • 0

I am implementing a Custom Identity class for an ASP.Net 4.0 site with Forms Authentication based on this tutorial:
Forms Authentication Configuration and Advanced Topics

I would like to store extra user information (First/Last Name, Gender, Geographic Region, Profile Picture Thumbnail Filename, etc…) in the AuthCookie. There is a warning on msdn.microsoft.com about limiting the size of the UserData property.

I have not been able to find a definitive character limit for the UserData property. Only that the entire encrypted cookie should be under 4096 bytes.

Anybody know a maximum character limit I should assume in my code? Or have a better idea about how to store these frequently needed pieces of user information?

Thanks

  • 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-25T12:07:13+00:00Added an answer on May 25, 2026 at 12:07 pm

    There’s no explicit limit – the maximum size will depend, for example, on the length of the username. Also the maximum size of a cookie (or of a URL if you’re using cookieless tickets) is browser-dependent.

    You could store that sort of information server-side (e.g. Session), possibly with some kind of key / id in the cookie. One way of doing this would be to implement a custom ProfileProvider.

    One disadvantage of storing application-specific information such as you describe in the FormsAuthentication cookie is that you will need some redesign if ever your application needs to switch from FormsAuthentication to some other authentication method (e.g. WindowsAuthentication).

    Personally I’d only store information that’s relevant for authentication and possibly authorization in the FormsAuthentication cookie, as anything else would increase coupling.

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

Sidebar

Related Questions

I have this question: Does implementing a custom MembershipProvider class needs you to implement
Implementing custom DataAnnotationsModelMetadataProvider in ASP.NET MVC2. Assuming the object that is being rendered looks
I'm using ASP.NET MVC and implementing custom validation via custom attributes/data annotations on my
I'm implementing a custom Button class that inherits from System.Windows.Forms.Button , I do a
I'm looking for some pointers on implementing Custom Events in VB.NET (Visual Studio 2008,
I'm implementing a custom control and in this control I need to write a
When implementing a custom equality function for a class, does it make sense to
I'm implementing the ValidateUser method on a custom MembershipProvider class. I've seen quite a
I followed the method of extending the User class for implementing custom users in
I'm having a small issue with implementing custom basic authentication for a asmx in

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.