English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Can Javascript read from a cookie created by PHP (and vice versa)?

2006-08-01 18:55:24 · 3 answers · asked by maniacrpg 2 in Computers & Internet Internet

3 answers

Yes. And no. A cookie can not be READ during the same page request that it is WRITTEN. So, if you're using PHP to write a cookie on a page that contains JavaScript, that cookie will be invisible, or the data will be old, from a previous request. If that's the type of data you need to pass, in an immediate situation, then a cookie is not the answer.

However, for passing data from one page click to another, yes, JavaScript and PHP can and do read the same cookies.

2006-08-05 05:17:20 · answer #1 · answered by Anonymous · 1 1

Yes a cookie is a Cookie have the same function for all programs
If you want to see how the cookie can be created,read and write
visit this:
http://www.quirksmode.org/js/cookies.html
Note:
quirKs ia a good site for all the problem about Javascrit
it create a "standard
Some times if you use FF and verify the code of a page you coould note 2option Standard mode quirks mode

2006-08-01 19:06:40 · answer #2 · answered by Ana 6 · 0 0

yes you can create them with PHP and retrieve them with javascript

good luck

2006-08-01 19:32:49 · answer #3 · answered by mdy 2 · 0 0

fedest.com, questions and answers