userfriendly
04-16-2003, 06:02 PM
I am setting cookies via CGI.. it is working on more than 80% of people's computers, but some people are having trouble.. there seems to be no common link between their web browsers. Not all people using IE6 are having the problem. I can't reproduce the problem for myself, but I have seen it on occasion.
What is happening is the browser (always Internet Explorer, mozilla never has a problem) is storing multiple cookies with the same key (as in key=value). In this case, the key name is 'session'.
This is not happening with any particular key, and I am never sending more than one Set-Cookie at a time.
This is what HTTP_COOKIE spits out when there is a problem:
HTTP_COOKIE :: Email=user@yahoo.com; tpath=clean; sid=proj.vjuebO/pPx1SU; slp=session.gGcD9RjiQuqAo1049570027; sid=proj.vjuebO/pPx1SU; Email=Guest; tpath=clean
Tweakin
04-16-2003, 06:15 PM
I am not sure if this is some sort of question, or bug post, or what.
If it's a question: Are you sure the %20 having problems havnt disabled cookies?
If it's a bug: I have never had that problem, try searching around for it.
userfriendly
04-16-2003, 06:30 PM
Originally posted by Tweakin
I am not sure if this is some sort of question, or bug post, or what.
If it's a question: Are you sure the %20 having problems havnt disabled cookies?
If it's a bug: I have never had that problem, try searching around for it.
It's a question and a bug post. When people have problems, they click a button to report them.. i get a copy of their environment variables.
I can see that they have cookies enabled.. they have duplicate keys listed, so they must be enabled.
The people that have problems I try to work with to see what is going on.
I have searched for the problem.. I have found others who have experienced the same problem.. but I have yet to find any fix or workaround.
WebmastTroy
04-17-2003, 04:42 AM
What are you using to set the cookie? I've ran into all kinds of problems setting cookies certain ways (Javascript-style, meta-style, etc.) and there is an inconsistancy when it comes to the people that can't compared to those that can.
Normally, I run the $ENV{'HTTP_COOKIE'} through a loop and split it up on the semicolon and then go from there. If you're setting multiple cookies through the same domain (even though it might not be entered, it's there), it will just tack on that information with the rest of it. Note that if you split on the semicolon and multiple key names are used, they will have a space at the beginning so make sure to take that out (took me a VERY long time to figure that out).
Hopefully the above helps a little. I guess I'm not sure I understand the question/problem.
DarktidesNET
04-17-2003, 05:24 AM
Good luck. I've dealt with cookies for a few years in JavaScript and PHP and there's always certain peoples browsers that they will not work properly in, regardless if they have them enabled or not ...
I think some browsers just expect them to be issued certain ways and most don't stick to a common format... but I'm really not sure.
userfriendly
04-17-2003, 12:11 PM
I'm setting this cookie by sending a Set-Cookie: prior to the Content-Type header.
I modified my program to ignore the duplicate keys.. it sees the first one as valid.. but this isn't good enough.
Fortunately, I have yet to see a user with more than two instances of a key.