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

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
 
J

jack

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?
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top