Вы можете сделать это -
FormsAuthenticationTicket _ticket = new FormsAuthenticationTicket(_version, _name, _issueDate, _expirationDate, _isPersistent, _userData, _cookiePath);
string _encryptedTicket = FormsAuthentication.Encrypt(_ticket);
HttpCookie _cookie = new HttpCookie("customticket", _encryptedTicket);
HttpContext.Current.Response.Cookies.Add(_cookie);
Затем вы можете написать код для проверки входящих запросов, чтобы увидеть, есть ли у них этот cookie -
HttpCookie _cookie = HttpContext.Current.Request.Cookies["customticket"];
if(_cookie){
_encryptedTicket = _cookie.Value;
FormsAuthenticationTicket _ticket = FormsAuthentication.Decrypt(_encryptedTicket);
if(!_ticket.Expired) {
IIdentity _identity = new FormsIdentity(_ticket);
IPrincipal _principal = new GenericPrincipal(_identity, new string[0]); //Identity plus string of roles.
}
}
else{
//dostuff
}