Can't Write Cookie IE

G

Guest

I am having trouble with my authentication cookie with IE. I create and write
the cookie here but some of the client PC never get the cookie. This does
work with other browsers like Firefox.

If Request.Cookies("portalroles") Is Nothing Then

Dim _user As New UsersDB
Dim roleStr As String = ""
Dim role As String

roleStr = _user.GetRoles(User.Identity.Name)


'For Each role In roles

'roleStr += role
'roleStr += ";"

'Next

Dim ticket As New FormsAuthenticationTicket(1, _
Context.User.Identity.Name, _
DateTime.Now, _
DateTime.Now.AddHours(1), _
False, _
roleStr)

Dim cookieStr As String = FormsAuthentication.Encrypt(ticket)


'Send Cookie to client
Response.Cookies("portalroles").Value = cookieStr
Response.Cookies("portalroles").Path = "/"
Response.Cookies("portalroles").Expires =
DateTime.Now.AddMinutes(5)

Worst part is this works on most of my clients but not on other.s
Thanks
 
C

Curt_C [MVP]

Are you sure the clients have their browser set to allow cookies?
Some dont.
 
G

Guest

Sorry I forgot to mention that. Yes we have worked and worked with the
clients including setting their privacy settings to nothing and this stil
doesn't seem to have any effect.
 
C

Curt_C [MVP]

GarrettD78 said:
Sorry I forgot to mention that. Yes we have worked and worked with the
clients including setting their privacy settings to nothing and this stil
doesn't seem to have any effect.

Ok... guess the next thing is to find out what IS different.
If one client works and the next doesnt and they both have the same
browser start looking deeper. Most likely its not a server issue, its a
client one. Firewalls, proxy servers, etc... also, OS ver, Service
Packs, etc....

Sorry I cant be more specific in this instance but its a difficult one
to know. There are a number of options
 
G

Guest

Well thanks. I have been trying to figure out what is different but haven't
had any luck. Just seems strange because you can surf other sites and the
cookies write and can be read fine but my site it won't work.
 
C

Curt_C [MVP]

GarrettD78 said:
Well thanks. I have been trying to figure out what is different but haven't
had any luck. Just seems strange because you can surf other sites and the
cookies write and can be read fine but my site it won't work.
I've had similar in the past and most of the time it ended up being the
security settings in IE actually, specifically the URL getting read as
intranet inadvertantly (or vice versa).

As a test just do a simple 2 page app with one writing and one reading
and put it out on your server and start with that as a control group, to
eliminate something with your specific site setup... just to see.
 

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,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top