Cookie corruption

I have a weird php redirect script issue that does the following:

  • Place a cookie in a user’s browser or read an existing cookie, if any.
  • Redirect the user to another URL (the redirect URL is a parameter in the source URL, for example http://my.redir.com?url=www.google.com ).
  • Record redirection (time, user agent, referrer, cookie).

From time to time (very rarely, one million), I see a cookie that has been corrupted in the log file. All cookies are in the format XXXX-XXXX when Xs are af or 0-9 (therefore, the valid cookie may be 7bfab3-d8694 ). Corrupt cookies have characters : or / that replace one of the characters or hyphens, for example. 7bfa:3-d8694 or 7bfab3/d8694 .

The question is , what could cause this? Could this be a problem with my script or the server it is running on, or would it rather be a problem in a user browser?

- Additional Information -

The corrupted cookies I found had user agents:

 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Sky Broadband; GTB7.1; Sky Broadband; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Sky Broadband) Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_4_11; en) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/4.1.3 Safari/533.19.4 
+4
source share
2 answers

All kinds of "breaking" robots are poorly written, full of mistakes. I see similar behavior in my magazines, for example. Invalid (invalid) HTML parsers for incorrect links, "disinfection" or URL encoding, and incorrect URL encoding, etc.

All this, while the line "agent" looks like a normal browser. I was terrified of this once before I noticed how several hundred different pages hit in a matter of seconds. There is no chance that this is a person who is surfing.

So, I suggest you try to see in your logs what else this IP / agent combination has visited, and if it's a robot, stop worrying about it.

+1
source

I would say that this is a malfunction on the client side. but it’s hard to say with all this traffic, if you use, for example, setcookie (), try using $ _SESSION ['sess'] = "cookie" instead and see if this problem persists. hope this helps, Regards.

0
source

All Articles