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. Advertisements

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. Sue
    Replies:
    5
    Views:
    2,587
    Shawn Mehaffie
    Jan 22, 2004
  2. Gary N.
    Replies:
    5
    Views:
    4,229
    Tony Morris
    Jan 18, 2004
  3. Orgil
    Replies:
    2
    Views:
    321
  4. bussiere maillist
    Replies:
    0
    Views:
    651
    bussiere maillist
    Dec 7, 2007
  5. Saddergoat

    Recieve a file via HTTP POST to a webservice

    Saddergoat, Sep 5, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    217
    Saddergoat
    Sep 5, 2003
  6. Julia
    Replies:
    7
    Views:
    482
    Bill Puetz
    Oct 22, 2004
  7. Orgil
    Replies:
    0
    Views:
    165
    Orgil
    Jun 9, 2007
  8. Diana
    Replies:
    1
    Views:
    271
    Diana
    Apr 6, 2004
Loading...