View Full Version : Phpbb3 cookies question
March 28th, 2013, 09:38 PM
Just a quick question. We have a phpbb3 forum on a subdomain and the gallery on another subdomain. Currently the forum settings for the cookie domain is the top level domain. I'd like to change it to the forum - so forum.oursite.com.
I don't understand how the integration between Photopost and phpbb3 works and it may be irrelevant but I just thought I'd check with you that changing it would not cause any problems for Photopost.
Does the cookie domain on phpbb3 matter or make any different to Photopost?
March 28th, 2013, 09:51 PM
If you want cookies to work correctly between both applications meaning the login to work between both then you need to set cookies to be site wide as noted in our cookie faq thread in the FAQ forum.
that means your cookies should be
cookie path /
cookie domain .yoursite.com
March 28th, 2013, 10:01 PM
Got it. I'm glad I asked.
March 28th, 2013, 10:42 PM
Yep very commonly asked question. ;)
April 26th, 2013, 03:44 PM
Are you aware that the settings we are using above makes the cookie settings incorrect for phpbb3 and they don't work, so the forum has to use session ids instead? This means we get the long id numbers on our page urls and the social network 'likes' or 'pluses' don't accrue for us. The Phpbb.com guys tell me to change it but obviously I can't or Photopost won't work.
April 26th, 2013, 04:04 PM
Are you aware you can set your cookies in the forum to match. ;)
I would love to school anybody who does not think the proper way to set a cookie so it is site wide is not this.
cookie path /
cookie domain .yoursite.com
Your welcome to do whatever you wish but if you set your forum cookie to not be usuable outside your phpbb directory then your forum cookie can not be read anywhere but over your forum.
There are tons of threads on the proper way to set site cookies all over the net and they all back up my tutorial on cookies.
I have no issues over the years since phpbb3 was released installing our gallery with the forum and no cookie issues whatsoever so not really sure what your referring to.
I know this because i wrote the phpBB3 integration. They have a section to set cookies you set the cookie name the cookie path and the cookie domain. As long as all those match between the forum and gallery to the same the cookie will be read between the apps.
If you set a cookie say with a path of /forum/ that cookie is only read over the forum. If you set a cookie domain as www.yoursite.com and your gallery is on yoursite.com those are two separate domains. This is why you set cookies site wide in both applications because if a cookie is sitewide it can be read over your entire site on every subdomain.
April 26th, 2013, 06:37 PM
Thanks for the reply Chuck. I am no whizz at this at all, so if there is a solution I would like to work it out.
I was told on phpbb.com that my current cookie domain is wrong and that it should be set to:
Am I misunderstanding?
At the moment my cookie domain in the forum settings is: .backyardpoultry.com and my cookie path is /
I thought that gave me site-wide cookies. This does not work for the forum and it is using session ids.
It seems you are saying there must be another reason this isn't working as my settings are correct.
April 26th, 2013, 07:53 PM
Your site is not www.forum.backyardpoultry.com
Your site is
Backyard Poultry Forum • Index page (http://forum.backyardpoultry.com/)
Backyard Poultry Gallery - Backyard Poultry Photo Gallery (http://gallery.backyardpoultry.com/)
Your cookies should be set as noted in my tutorial and they will work with both applications. There should be no reason that your forum can not read a site wide cookie.
The users posting on that free phpbb thread have no idea what they are talking about.
If I login to your forum I am logged into your gallery and vice versa so there is nothing wrong with your cookies.
If your forum has a bug you can report it but there is nothing at all wrong with how your cookies are set.
Like I said every single tutorial on cookies will tell you setting a site wide cookie is the way to go to read across all sub domains on a site.
You can like I said change your cookies all you want on the forum side but do not expect to be logged into the gallery when you go to it. You would need to login again.
April 28th, 2013, 01:39 PM
If you want me to look at it you can send data for me to see how you have things set.
April 30th, 2013, 05:29 AM
Do you mean send you login details so you can look? You don't receive pms so not sure how to do that.
I think I have set the cookies as per your tutorial so the error must be in the forum although I don't know where.
April 30th, 2013, 08:16 AM
The point I am making is you need to be clear on what you actually think your issue is. Just because some one tells you your setting is wrong does not mean it is. ;) Your talking about some forum bug maybe.
You came here making a broad base false statement saying our cookie tutorial is wrong where it is not and actually our tutorial as stated can be backed up by facts.
phpBB3 is a free forum there is no support or guarantee that when your posting on that free site your actually getting responses from someone who knows what they are talking about. ;)
The point I have made is that if cookies are set correctly there is no issue with being logged in either application. As I posted I have already looked at your site and it appears to work perfectly. If you log in to the gallery you are logged into both apps. You logout and login to the forum you are logged into both apps.
If you set your cookie domain to
the resulting cookie only works over the forum.
Since your cookie domain is
that cookie is readable over EVERY subdomain on your site making it sitewide.
That is how you get a cookie to be used over an entire domain name because if the subdomain is different that is a completely different url.
You would have to deal with forum bugs with phpBB3 developers as a piece of software should have no issue reading cookie settings that you set in the application and being that the cookie settings are site wide there should be no issues.
The problem your going to have dealing with phpBB3 is it is a free forum and no real support meaning the answers your doing to get 99.9% of the time are going to be from non developers.
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.