HOW TO STORE ADDITIONAL USER INFORMATION IN FORMS AUTHENTICATION

When using Forms Authentication, it can be desirable to store additional information with the authentication cookie, like the user's first name, or whether or not they are an admin. Thankfully, while not super intuitive, Forms Authentication does provide this using the FormsAuthenticationTicket's UserData property.

The UserData property is a string, so you can store pipe-separated data, or even a serialized object.

The Code

To see the full gist, click here.

Further Reading

How to Store Additional User Information in Forms Authentication
12.07.2018 ~ 03:49 PM
posted in professional
tagged in c# : forms-authentication
comments [1]

 
 
 
 
@ Seth Lau
Hello, You can now get a complete list of all your website visitors within the last 12 months using the new Web Leads 2.0 Extension. The Web Leads report contains all company names, addresses, phone numbers, websites, contact person, email addresses, and important metrics that track your website’s most popular pages. For more details and free access, visit the link below. http://bit.ly/analyticsleads Sincerely, Fastbase [Extension to Google Analytics]
5.23.2019 - 05:06 PM
 
 

SPEAK!

Please enter your comment below.