SetAuthCookie works, but our cookies aren't being written - HELP

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

All

We recently started writing a couple encrypted values to the user's cookie using FormsAuthentication.Encrypt. Such as:
Dim tmpTicket1 As New FormsAuthenticationTicket(1, "TEST", Date.Now, Date.Now.AddMinutes(60), False, "Boom1")
Dim tmpResults1 As String = FormsAuthentication.Encrypt(tmpTicket1)
Response.Cookies.Add(New HttpCookie("TEST", tmpResults1))

And then we are reading it like:
Request.Cookies("TEST")

BUT - we are noticing that in some cases, people who *do* accept session cookies (confirmed because their cookie session works and FormsAuthentication.SetAuthCookie works) do *NOT* accept our non persistant cookie. The frustrating thing is that we cannot recreate the issue, so I grasping at straws.

Is there anything glaringly wrong with the code listed above? Further, how exactly is ASP.NET setting the cookie through SetAuthCookie that sticks, but ours don't stick?

Thanks!

Tyson
 
I have the same Problem.

If you find an answer let me know please!

Tyson Brown said:
All,

We recently started writing a couple encrypted values to the user's cookie
using FormsAuthentication.Encrypt. Such as:
Dim tmpTicket1 As New FormsAuthenticationTicket(1, "TEST", Date.Now,
Date.Now.AddMinutes(60), False, "Boom1")
Dim tmpResults1 As String = FormsAuthentication.Encrypt(tmpTicket1)
Response.Cookies.Add(New HttpCookie("TEST", tmpResults1))

And then we are reading it like:
Request.Cookies("TEST")

BUT - we are noticing that in some cases, people who *do* accept session
cookies (confirmed because their cookie session works and
FormsAuthentication.SetAuthCookie works) do *NOT* accept our non persistant
cookie. The frustrating thing is that we cannot recreate the issue, so I
grasping at straws.
Is there anything glaringly wrong with the code listed above? Further, how
exactly is ASP.NET setting the cookie through SetAuthCookie that sticks, but
ours don't stick?
 
Back
Top