Ok Thanks,

Here is what i've found in MS Press literature and it's ok :

If FormsAuthentication.Authenticate( _
txtNom.Text, txtMP.Text) Then
Dim sRoles As String = "Ut;R1;R2"
Dim Fat As New FormsAuthenticationTicket(1, _
txtNom.Text, DateTime.Now, _
DateTime.Now.AddMinutes(60), False, sRoles)
Dim sFatCrypte As String = _
FormsAuthentication.Encrypt(Fat)
Dim CookieAuth As New HttpCookie("TicketAuth", _
sFatCrypte)
Response.Cookies.Add(CookieAuth)
FormsAuthentication. _
RedirectFromLoginPage(txtNom.Text, False)
End If


And then, in another page :

Dim CookieAuth As HttpCookie = _
Request.Cookies("TicketAuth")

If CookieAuth Is Nothing Then
Exit Sub
End If

Dim fat As FormsAuthenticationTicket

Try
fat = FormsAuthentication. _
Decrypt(CookieAuth.Value)

Catch ex As Exception
lblMessage.Text = "Exception : " & ex.Message
End Try

If fat Is Nothing Then
lblMessage.Text = "Le décryptage a échoué."
Exit Sub
End If

lblMessage.Text = "Roles : " & fat.UserData

' Pour créer un objet Principal
' associé à la requête :
Dim fi As New FormsIdentity(fat)
Dim gp As New GenericPrincipal(fi, _
fat.UserData.Split(";"))
context.User = gp

Best regards ;-)
Gilles

*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!