Re: Accessing cookies in PHP and Javascript

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Your favorite search engine would provide you with far better JavaScript answers than a PHP mailing list...

Otto Wyss wrote:
Assuming I have a cookie

setcookie ("username",$_SESSION['Username'], $expires);

how can I access the same cookie in Javascript?

Parse out document.cookie.

Or how do I have to create a cookies so it's accessable as

$_COOKIE["username"]

document.cookie = "username=" + escape(username);

You can add expiry, path, etc. with JavaScript, but you can google for that.

jon

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux