Recieve Post, New Session Won't Stick, Cookielss

Discussion in 'ASP .Net Security' started by Jimmy Jazz, Sep 2, 2005.

  1. Jimmy Jazz

    Jimmy Jazz Guest

    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
     
    Jimmy Jazz, Sep 2, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gary N.
    Replies:
    5
    Views:
    4,040
    Tony Morris
    Jan 18, 2004
  2. Orgil
    Replies:
    2
    Views:
    249
  3. bussiere maillist
    Replies:
    0
    Views:
    511
    bussiere maillist
    Dec 7, 2007
  4. Tim Chase
    Replies:
    0
    Views:
    591
    Tim Chase
    Dec 7, 2007
  5. Orgil
    Replies:
    0
    Views:
    107
    Orgil
    Jun 9, 2007
Loading...

Share This Page