Jump to content


Photo

problem with cookie


  • Please log in to reply
3 replies to this topic

#1 newman

newman
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 05 September 2006 - 08:54 PM

hi all . i've got a problem with cookies .
when i add www in my URL the cookies do not work .
1 ) http://mydomain.com ( cookies work )
2 ) http://www.mydomain.com ( cookies do not work )
have anyone had this problem ?
thanks in advance .

#2 newman

newman
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 06 September 2006 - 12:20 PM

can anyone help ?

#3 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 06 September 2006 - 12:46 PM

hwat parameters are you passing to the setcookie function?
follow me on twitter @PHPsycho

#4 arianhojat

arianhojat
  • Members
  • PipPipPip
  • Advanced Member
  • 235 posts

Posted 06 September 2006 - 12:57 PM

http://www.php.net/m...n.setcookie.php

domain argument for setcookie: "To make the cookie available on all subdomains of example.com then you'd set it to '.example.com'. The . is not required but makes it compatible with more browsers. Setting it to www.example.com  will make the cookie only available in the www  subdomain"

so to make it work for everything, maybe try ".mydomain.com" as the domain argument in setcookie()




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users