I am开发者_如何转开发 trying to use Cookies to send information from php to javascript. but while the coockie saved fine on $_COOKIE, from javascript i can only see:
PHPSESSID=e5289f50a9971fd0e1c954904056290e
any ideas about whats I'm doing wrong?
Trying to pass information from php to javascript will make things very complex if not impossible. Why don't you use PHP only for handling cookies if you have server side coding involved? And JavaScript only if you are concerned about client side only? There are plenty of tutorials available to handle cookies in JavaScript as well as in PHP. For javaScript you may refer this wikipedia writeup or visit w3resource JavaScript Cookies tutorial. For PHP visit PHP Cookies from PHP Manual or w3resource PHP cookies tutorial. Hope these help.
精彩评论