Torna al Thread

FormsAuthentication.SetAuthCookie(Me.txtUser.Text, True) ''-------------------Profilo--------------------- Dim ticket As FormsAuthenticationTicket = New FormsAuthenticationTicket(1, _ Me.txtUser.Text, _ DateTime.Now, _ DateTime.Now.AddMinutes(30), _ True, _ GetRuoloUser(Session("ID_Utente")).ToString, _ FormsAuthentication.FormsCookiePath) Dim encTicket As String = FormsAuthentication.Encrypt(ticket) Response.Cookies.Add(New HttpCookie(FormsAuthentication.FormsCookieName, encTicket)) Dim Ruolo As String = GetRuoloUser(Session("ID_Utente")).ToString Dim Roles(9) As String Roles(0) = GetRuoloUser(Session("ID_Utente"))(0) ' Data.GetUserRoles(User.Identity.Name) Dim ID As FormsIdentity = CType(HttpContext.Current.User.Identity, FormsIdentity) HttpContext.Current.User = New System.Security.Principal.GenericPrincipal(ID, Roles)
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5