home / software / tips and tricks / How to add user role to FormsAuthentication in MVC?

How to add user role to FormsAuthentication in MVC?

Updated:  07/15/2013 14:07 PM
Author:  Shiju Mathews

Status:    Resolved.


It is possible to add custom information to FormsAuthentication in MVC. The user role associated with the current user can to added to FormsAuthenticationTicket as uaer data, and this ticket can be attached to the Authentication cookie.
Add the following namespaces to the controller

using System.Web.Security;
using System.Security.Principal



This cookie can be retrived to get the data back. I am retriving the data on Global.asax as follows.

Tags: How to add user role to FormsAuthentication in MVC?
Updated on: March 2024