J
Jimmy Jazz
Newbie question,
Using cookieless forms authentication.
I am recieving a post from another server (Actually as a Get becasue my
IIS will not let a post through).
I try to build a ticket the same way I always have (code below) but no
new session variable is attached to the url; all the variables in the
original post stick around. I am assuming I am missing something
simple.
Protected Sub buildSessionTicket()
Dim currentContext As HttpContext = HttpContext.Current
Dim formsCookieStr As String = String.Empty
Dim ticket As FormsAuthenticationTicket
abandonPreviousSession()
If Not int_UserID <= 0 Then
Dim str_UserId As String = CStr(int_UserID)
FormsAuthentication.SetAuthCookie(str_UserId, False)
ticket = New FormsAuthenticationTicket(1, _
CStr(int_UserID),
_
DateTime.Now, _
DateTime.Now.AddMinutes(30), _
False, _
userRole.ToString)
formsCookieStr = FormsAuthentication.Encrypt(ticket)
Dim FormsCookie As HttpCookie = New
HttpCookie(FormsAuthentication.FormsCookieName, formsCookieStr)
Response.Cookies.Add(FormsCookie)
End If
End Sub
Using cookieless forms authentication.
I am recieving a post from another server (Actually as a Get becasue my
IIS will not let a post through).
I try to build a ticket the same way I always have (code below) but no
new session variable is attached to the url; all the variables in the
original post stick around. I am assuming I am missing something
simple.
Protected Sub buildSessionTicket()
Dim currentContext As HttpContext = HttpContext.Current
Dim formsCookieStr As String = String.Empty
Dim ticket As FormsAuthenticationTicket
abandonPreviousSession()
If Not int_UserID <= 0 Then
Dim str_UserId As String = CStr(int_UserID)
FormsAuthentication.SetAuthCookie(str_UserId, False)
ticket = New FormsAuthenticationTicket(1, _
CStr(int_UserID),
_
DateTime.Now, _
DateTime.Now.AddMinutes(30), _
False, _
userRole.ToString)
formsCookieStr = FormsAuthentication.Encrypt(ticket)
Dim FormsCookie As HttpCookie = New
HttpCookie(FormsAuthentication.FormsCookieName, formsCookieStr)
Response.Cookies.Add(FormsCookie)
End If
End Sub