Функция чтения cookies (JavaScript)

function readCookie(n) {
  n = n.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1");
  n = RegExp("(?:^|;)\\s?" + n + "=(.*?)(?:;|$)", "i");
  return (n = document.cookie.match(n)) && unescape(n[1])

P.S.: This function reads browser cookies ;)

дядь Саша

hardcore javascript & php programmer, passionate reverse engineer

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.