PDA

View Full Version : Problem with cookies...



masterjguscius
01-26-2009, 09:37 PM
Hey everyone,
I use non-ascii cookie names trough PHP (for example: sausainėlis[forumiečio_slapta×odis]) and js can't read those. I've tried document.cookie and browser gave me this name:
sausain─Ślis1[forumie─?io_slapta┼żodis]

Please help me to get value of this damn cookie...

function get_cookie(cookie_name) {
var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
if ( results ) return ( unescape ( results[2] ) );
else return null;
}