Recieve Post, New Session Won't Stick, Cookielss

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top