Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Mar 2000
Posts: 528
Junior Member
Junior Member
Offline
Joined: Mar 2000
Posts: 528
Is there a setting I am missing to set a cookie to read from either variation of the same domain?

http://domain.com
http://www.domain.com

Just curious, may not even be possible, I have just never seen anything out here about it.

Sponsored Links
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Doesn't just a single fowrward slash alone do that for a site wide setting?

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
should be / for site wide yes but I don't think that works across domains.. I think what ya need is a htaccess entry so that www.yourdomain.com = yourdomain.com

Joined: Mar 2000
Posts: 528
Junior Member
Junior Member
Offline
Joined: Mar 2000
Posts: 528
Yea, trying to figure out the .htaccess command to do that now.

Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
But that still won't help the cookie get read. You need to set the cookie for the domain name ".domain.com" <-- Notice the dot at the start. That tells the browser to send this cookie to anything.domain.com.


UBB.classic: Love it or hate it, it was mine.
Sponsored Links
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Often this is default on the server - I know it is under Plesk to automatically go from domain.com to www.domain.com.

Threads should be now allow you to set the cookie to one domain (I don't know if 6.5 allows this????) - so therefore www.domain.com would work, as would photos.domain.com, links.domain.com and of course just domain.com

At the moment both here and ubbcentral - if you are logged in at www.ubbcentral.com or www.ubbdev.com you are logged OUT at ubbcentral.com and ubbdev.com


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305

If your site can be accessed as both http://www.domain.com/ as well as http://domain.com/ and are having trouble with things such as cookies on the Netscape browser*, here is a little rewrite rule you can place in your httpd.conf or on a per directory basis using .htaccess.

Here is what happens. When you request a page such as http://domain.com/x.html, the rewrite engine checks to see if the HTTP_HOST does not match the fully qualified domain name (FQDN) which in this case is www.domain.com. If they do not match, the engine rewrites the URL with the SERVER_NAME value, so make sure that your SERVER_NAME in your httpd.conf is the FQDN.


RewriteEngine On
RewriteCond %{HTTP_HOST} !www.domain.com
RewriteRule ^.*$ http://%{SERVER_NAME}%{REQUEST_URI} [R]

*About the Netscape Cookie Problem: If you issue a cookie from www.domain.com using a string such as "domain=.domain.com", it cannot be read by domain.com, fred.domain.com, and so on. MSIE does not have this trouble. If you force all your URLs to start with www. and issue the cookie using domain=www.domain.com, this resolves the problem


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
badfrog
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)