cloudflare / lua-resty-cookie

Lua library for HTTP cookie manipulations for OpenResty/ngx_lua
347 stars 160 forks source link

patch solving problem with broken cookies without "=" #14

Closed defragmentator closed 1 year ago

defragmentator commented 8 years ago

Patch fixes problem when for some reason browser has broken cookie without "=" sign, generated as example from script below: <?
header("Set-Cookie: verybadcookie;");
setcookie("silexsession","idnum");
?>
Safari just ignore cookies like that, but opera, firefox and chrome save them as value with null key. IE sends them without key but present internal as cookie1, cookie2 and so on. The real problem occurs when after broken cookie there is some real one, because library parses thees two cookies from example as one with key="verybadcookie; silexsession" and value="idnum". It is quite unlike situation, but it took me long time to find out why one of my LUA scripts sometimes were going crazy.

maurizioabba commented 1 year ago

Seeing this now. Assuming fine to close, please reopen if interested