Language URL parameter is not session persistent

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Bermudez
Registered User
Posts: 127
Joined: Mon Aug 15, 2011 11:56 pm
Location: Spain
Name: Juan Antonio
Contact:

Re: Language URL parameter is not session persistent

Post by Bermudez » Thu Jan 10, 2019 11:50 pm

MichaT wrote:
Thu Jan 10, 2019 11:37 pm
i tried my board with IE too and no cookies are saved using index.php?language=es. so it doesnt matter if i use FF, chrome of IE. no cookies everywhere.

after that i tried your board with FF and i see 6 cookies created from your board incl. the cookie from using index.php?language=es!

and i tried another test: i activated my extension "Guest Language Selector" using FF with index.php?language=es. i can see the cookie i use to save the selected language but still no other cookies...

after i login at my board i dont see any new cookies. i only see the cookie from my extension...

maybe the default configuration of phpBB3.2.5 saves no cookies? is there somewhere a option to enable this?
Maybe you have the cookies incorrectly configured in the ACP of your board.
I recommend that you read this article → Fixing incorrect cookie settings

User avatar
EA117
Registered User
Posts: 319
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Language URL parameter is not session persistent

Post by EA117 » Fri Jan 11, 2019 12:46 am

Bermudez wrote:
Thu Jan 10, 2019 11:50 pm
MichaT wrote:
Thu Jan 10, 2019 11:37 pm
i tried my board with IE too and no cookies are saved using index.php?language=es. so it doesnt matter if i use FF, chrome of IE. no cookies everywhere.
I recommend that you read this article → Fixing incorrect cookie settings
I agree with Bermudez... "no cookies regardless of browser" generally fits with what would be seen because of a cookie configuration problem specific to the phpBB site you're testing against. That's at least one thing to rule out, if you hadn't already by the time I'm done writing the rest of this.

What's suspicious to me though is that I would have expected (or at least by default assumed) that your extension to be reliant on the exact same phpBB cookie configuration settings, yet the cookie for your extension is saving successfully on this same site. It certainly depends upon exactly how it's being done, but I would have expected an extension leverages the existing cookie support functions in phpBB, is using the same cookie domain configuration as the rest of the site, etc. I'm not an extension writer and can be wrong on that, though.

MichaT wrote:
Thu Jan 10, 2019 11:37 pm
after that i tried your board with FF and i see 6 cookies created from your board incl. the cookie from using index.php?language=es!

and i tried another test: i activated my extension "Guest Language Selector" using FF with index.php?language=es. i can see the cookie i use to save the selected language but still no other cookies...
Okay, so that at least gets us away from "cookies aren't being saved at all by the browser(s)."

And I presume when you tested on the site where the phpBB cookies were being successfully saved, you also saw the expected and intended language selection persist as you navigated pages, even though the "language=es" parameter was no longer in the URL?

I presume so, and that this answers the original support question of "why doesn't phpBB do this?" (Answer: actually, it does do this.) And that now we're moving on to answer the question of why the cookies aren't saving for the specific site you're testing and developing on.

MichaT wrote:
Thu Jan 10, 2019 11:37 pm
maybe the default configuration of phpBB3.2.5 saves no cookies? is there somewhere a option to enable this?
Not that I'm aware of; both clean installations and upgrades of prior versions have always saved by default for me. I'll admit I've never done a deep dive into the manner in which the cookies ultimately get persisted. But I still think it's correct to say that phpBB will utilize and save cookies by default.

So what could fit with "I see my extension's cookie being saved, but none of the other site cookies."

One thing that comes to mind is "I've blocked those cookies before", or "I have a network security product on the local machine or upstream which has been asked to block those cookies." Something that would try and fit with the "saving my cookie for my extension running on the same site is fine (because the name of that cookie isn't in the blocked list), but not phpBB's own cookies for the site (because those names were blocked at some point)." That's an aspect that "test from a completely different machine or location" (e.g. my phone on it's 4G connection, instead of my local network and ISP) could help rule out.

However, because active development is involved, in my experience it would be better to assume I broke something instead of "someone is doing this to me." Meaning we should suspect that the extension -- perhaps even specifically in the manner it chose to save it's own cookie -- is somehow causing the header cookie data that was being accumulated to be overwritten or otherwise unintentionally lost. Does completely disabling your extension on the test site that is failing -- and maybe any other in-development or questionable changes that might also be present -- then magically allow the normal phpBB site cookies to be seen and saved?


edit: Finally searched outside the context of this thread, and found your posted 1.0.1 extension and looked at the code. The 1.0.1 version of this extension is now installed on the site I'm testing against, if you want to hit it there. And I see the site's phpBB cookies being saved in addition to the extension's cookie. So to me that rules out that the code was somehow unintentionally resetting the cookie list being maintained as the phpBB response is being generated.

The extension appears to be calling the php setcookie() directly, and not any phpBB-specific cookie support functions. Which means my assumption was wrong, and "no, the extension is not dependent on the same phpBB site cookie configuration settings as the rest of the cookies being saved." Meaning we could indeed be back to simply "the phpBB cookie configuration on the site you're testing with is wrong", as Bermudez pointed out.

MichaT
Registered User
Posts: 15
Joined: Sat Jan 05, 2019 5:44 am
Location: Thailand
Name: Michael

Re: Language URL parameter is not session persistent

Post by MichaT » Fri Jan 11, 2019 1:48 am

Bermudez wrote:
Thu Jan 10, 2019 11:50 pm
Maybe you have the cookies incorrectly configured in the ACP of your board.
That was the solution!

Before i copied the DB and the phpBB board files to another domain to test the upgrade from v3.0.11 to v3.2.5 but i didnt check/update the cookie settings that pointed to the original server...

thx Bermudez for the hint about the cookie settings and thx EA117 for your extraordinary help!

Post Reply

Return to “[3.2.x] Support Forum”

Who is online

Users browsing this forum: Baidu [Spider], EA117, Exabot [Bot], MosesTM, stevemaury and 20 guests