User:Mike Dillon/Scripts/cookies.js: Difference between revisions

Content deleted Content added
No edit summary
name cookie names for reading case insensitive per RFC
Line 2:
 
function readCookie(name) {
var nameMatch =if (!name) + "="return;
var nameMatch = name.toLowerCase() + "=";
var cookies = document.cookie.split(";");
for (var i in cookies) {
if (cookies[i].toLowerCase().indexOf(nameMatch) == 0) {
return cookies[i].substr(nameMatch.length);
}