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]

 
 
 
 
@ Kenneth Evans
G'day, I'll keep this brief. We run a guest posting platform that allows our clients to get backlinks from our database of sites. For publishing each article, we pay these sites a set editorial fee. Is this something that would interest you? If yes, then more details can be found here including a sign up form: https://goo.gl/forms/RtWIvojZxyZaw4VB2 Hope to hear from you soon and thanks for your time. Kind Regards, Kenneth Evans P.S: Kindly note, this is a paid guest post opportunity only.Thanks
3.16.2019 - 01:15 AM
 
 

SPEAK!

Please enter your comment below.