localhost subdomain cookie issue

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
Rithe
Registered User
Posts: 22
Joined: Mon May 12, 2008 3:50 pm

localhost subdomain cookie issue

Post by Rithe » Thu Aug 28, 2008 7:43 pm

I know this should work, I did it with my main site. I set up some subdomains on localhost to do testing with the dev version of my site, mainly to see how things will work differently. I got the subdomains working fine, with the forum at forums.localhost. I changed the cookie and system settings so that they now look like:

cookie domain: .localhost
cookie name: phpbb3_cke
cookie path: /

domain name: forums.localhost
script path: /

I think those are the relevant bits. I guess the main problem is that cookies don't get set at all for anything. Well, there is the style_cookie for forums.localhost, but nothing else. No session cookies, user related ones, nothing. Is there an issue with doing subdomains on localhost that I'm not aware of? I was expecting to see a set of them for .localhost.

I think my next test will be to set a dummy domain up in my hosts file, and create the subdomains and such up for that in my apache config. Maybe that will work.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51785
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: localhost subdomain cookie issue

Post by Brf » Thu Aug 28, 2008 7:49 pm

No. You cannot use localhost as a cookie domain.
You might be able to use an IP address, if you browse to your forums that way.
You are best off setting up a fake domain in your hosts file.

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50583
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: localhost subdomain cookie issue

Post by stevemaury » Thu Aug 28, 2008 7:51 pm

Take the dot off the front of localhost.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

Rithe
Registered User
Posts: 22
Joined: Mon May 12, 2008 3:50 pm

Re: localhost subdomain cookie issue

Post by Rithe » Thu Aug 28, 2008 8:10 pm

That makes sense. I just made my hosts changes, and the forum settings, and now I'm seeing cookies! Thanks.

mokusbajusz
Registered User
Posts: 13
Joined: Mon Dec 15, 2008 10:54 am
Contact:

Re: localhost subdomain cookie issue

Post by mokusbajusz » Wed Jan 07, 2009 10:51 am

Brf wrote:No. You cannot use localhost as a cookie domain.
You might be able to use an IP address, if you browse to your forums that way.
Thank you for that hint. Using the IP address of my localhost solved the problem.
And it works even with a dot (.) in front of the IP address as well (JFusion recommended setting).

Locked

Return to “[3.0.x] Support Forum”