Question

I am using the formauthentication and as the user.identity.name I am using they're email, How can I change it to were I can use they're unique Registration ID instead?

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,model.Email, DateTime.Now, cookieExpiration, true,model.Email);

The model.Email is the Email that the users have and its a String parameter I instead would like to put model.RegistrationID .

Was it helpful?

Solution

You can't change its data type but you can do what you want by keeping the RegistrationId in the database as string.

FormsAuthenticationTicket ticket= new FormsAuthenticationTicket(RegistrationId.ToString() ,model.Email, DateTime.Now,cookieExpiration, true,model.Email);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top