Skip to content

Commit

Permalink
fixed opCookie.get can't retrieve the first data of cookie (fixes ope…
Browse files Browse the repository at this point in the history
  • Loading branch information
upsilon committed Feb 18, 2010
1 parent 218fd81 commit a0cdaa0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions web/js/util.js
Expand Up @@ -109,11 +109,10 @@ var opCookie = {
var cookies = _cookie.split(';');
for (var i = 0; i < cookies.length; i++)
{
var _cookie = cookies[i];
var valuePos = name.length + 1;
if (_cookie.substr(0, valuePos + 1).strip() == (name + '='))
var _cookie = cookies[i].strip();
if (_cookie.startsWith(name + '='))
{
value = decodeURIComponent(_cookie.substr(valuePos + 1)).strip();
value = decodeURIComponent(_cookie.substr(name.length + 1)).strip();
break;
}
}
Expand Down

0 comments on commit a0cdaa0

Please sign in to comment.