Jump to content


Photo

Cookie with PHP and Javascript


  • Please log in to reply
2 replies to this topic

#1 amalosoul

amalosoul
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 15 October 2006 - 08:45 PM

I have created a cookie with $_SESSION[var]=variable; can javascript access this cookie called var?
If yes how can this be done?

Thank you in anticipation!

#2 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 16 October 2006 - 02:06 AM

A session variable is not a cookie, a cookie variable is not session variable. Other than that, any cookie set with the PHP(s) function setcookie() can be read by javascript as long as the cookie flag httponly is not set in the cookie! If it is set httponly, then javascript can not access the cookie variable=value!


me!

#3 amalosoul

amalosoul
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 16 October 2006 - 09:25 AM

Thank you! I find out new things every day:)!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users