setting common cookie to the whole domain

Javascript coding ..

Moderators: macek, egami, gesf

snsanju
New php-forum User
New php-forum User
Posts: 42
Joined: Thu Aug 04, 2005 1:35 am
Location: Bangalore, India
Contact:

setting common cookie to the whole domain

Postby snsanju » Sun Aug 07, 2005 9:09 pm

i want set cookies for the site say http://www.example.com using the javascript and the code i am using is

cookiestring="NAME="+value+";EXPIRES="+duration;
document.cookie = cookiestring;

so it is working fine but when i use same code to set Domain name as ".example.com" as
cookiestring="NAME="+value+";EXPIRES="+duration+";DOMAIN=.example.com";
then its not working.
also i tried to by giving PATH=/ its not creating the cookie

these cookies i want for redirecting depending on the sub domain like abc.example.com or xyz.example.com

how to set common domain ie .example.com for domain as well as subdomains to access from any domains.
if name of the cookie is 'city' i must able to access that cookie from http://www.example.com, abc.example.com or xyz.example.com

Return to “JavaScript”

Who is online

Users browsing this forum: No registered users and 1 guest

cron