Print Page | Close Window

Read Cookies from multiple domain

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=4466
Printed Date: 13 April 2026 at 9:53pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Read Cookies from multiple domain
Posted By: sherwood168
Subject: Read Cookies from multiple domain
Date Posted: 23 July 2003 at 11:22am

Is it possible to modify the program to read cookies from multiple domain? for example, if the current forum is located at http://www.sherwood.com/forum - http://www.sherwood.com/forum , however, this url also aliased to http://forum.sherwood.com - http://forum.sherwood.com . Is it possible for users continue to use the settings?

Thanks,

Sherwood




Replies:
Posted By: ljamal
Date Posted: 23 July 2003 at 11:29am
you will need to set the cookie domain to simply
"sherwood.com" and set the path to "/"

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: michael
Date Posted: 23 July 2003 at 12:05pm
I don't think that is possible though. It is seen as a seperate domain when you have a subdomain. It would be bad is customer1.isp.com could read the cookies of customer2.isp.com

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: ljamal
Date Posted: 23 July 2003 at 12:25pm
In the example above customer1 and customer2 could only read each others cookies if the domain was set to simply "isp.com" by default the domain is set to the domain (and sub domain) from which the cookis is set however if you set the domain name to simply the domain without a sub domain then it is accessible for any sub domains because cookies aren't accessible across domains (not sub domains).

If you go to webwiz.net you will note that you are not logged into the forum, if you logged in at www.webwiz.net.

Go back to www.webwiz.net and log out. Now go to webwizwguide.info and log in. Now return to www.webwiz.net and note that you are logged back in. Furthermore if you try to log out at www.webwiz.net you can't, and you need to go back to webwiz.net to log out.

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: michael
Date Posted: 23 July 2003 at 3:39pm
bummer. Thanks Jamal

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: sherwood168
Date Posted: 23 July 2003 at 3:42pm
But how to change the source code to place the cookie at "/"?


Posted By: ljamal
Date Posted: 23 July 2003 at 4:46pm
The syntax is
Response.Cookies("cookie").Path ="/"
Response.Cookies("cookie").Domain ="domainname"

where cookie is the name of your cookie and domainame is the your domain (with or without the subdomain).


-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: SiteMaster
Date Posted: 30 August 2005 at 6:50am
okey but i still get the error, where in the code do i put it



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net