Cookies being set to the wrong time?

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
User avatar
3Di
Former Team Member
Posts: 15846
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Cookies being set to the wrong time?

Post by 3Di »

MarkDHamill wrote:
Sat Jul 11, 2020 11:56 pm
looks like a Vivaldi bug
Vivaldi is like a DuckDuckGo browser, I am not surprised it is deleting tracks for privacy reasons.

But the real question IMHO is: who really uses Vivaldi into a code development context? :?

Somebody tells it is faster with slower PCs? DO you have a slow PC that you need a lighter browser?
Are you sure it loads faster in this case? A quick search is telling me that's not completely true.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
:studio_microphone: Looking for a specific feature or alternative option?
User avatar
MarkDHamill
Registered User
Posts: 4243
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: Cookies being set to the wrong time?

Post by MarkDHamill »

An update on this. After much debugging I determined that line 797 of session.php:

Code: Select all

			$cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000);
won't add 31536000 to $this->time_now, which is the correct Unix timestamp. $config['max_autologin_time'] BTW is a hidden configuration variable. Apparently it can only be changed in the database.

Not sure why this is an issue on this particular server. Obviously it works just fine virtually everywhere else. But in this case, 0 is apparently added to $cookie_expire, not 315356000 (number of seconds in a year). It's possible some typecasting would solve this problem:

Code: Select all

			$cookie_expire = $this->time_now + (int) (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000);
I found a workaround by changing $config['max_autologin_time'] in the database. This is the number of days, so if the value is 1, it will add 86400 seconds (1 day) to $cookie_expire. I had to purge the cache to get the value to be used.

This strikes me as pretty bizarre.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Kindle and paper versions available.
User avatar
3Di
Former Team Member
Posts: 15846
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Cookies being set to the wrong time?

Post by 3Di »

MarkDHamill wrote:
Tue Jul 14, 2020 11:43 pm
$config['max_autologin_time'] BTW is a hidden configuration variable. Apparently it can only be changed in the database.
Did you read the previous posts? :?
3Di wrote:
Sat Jul 11, 2020 11:03 pm
MarkDHamill wrote:
Thu Jul 09, 2020 9:57 pm
(Unless I'm missing it, I can't find the setting in the ACP, so I did it via the database then purged the cache.)
ACP/server configuration/security settings


Image
Just inspect this element and you will see that's it.
MarkDHamill wrote:
Tue Jul 14, 2020 11:43 pm
This is the number of days, so if the value is 1, it will add 86400 seconds (1 day) to $cookie_expire.
And that's ALSO something we are trying to explain you since ages. :D
MarkDHamill wrote:
Tue Jul 14, 2020 11:43 pm
I had to purge the cache to get the value to be used.
Configs are cached, nothing new here.

You might want to add all of this to your book I guess. ;)
Last edited by 3Di on Tue Jul 14, 2020 11:56 pm, edited 1 time in total.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
:studio_microphone: Looking for a specific feature or alternative option?
User avatar
MarkDHamill
Registered User
Posts: 4243
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: Cookies being set to the wrong time?

Post by MarkDHamill »

That value is set to 1, so presumably they would expire normally in one day. Instead, they expired immediately.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Kindle and paper versions available.
User avatar
3Di
Former Team Member
Posts: 15846
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Cookies being set to the wrong time?

Post by 3Di »

Okay, I see you are not following the discussion, you are on your own and apparently proud of it.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
:studio_microphone: Looking for a specific feature or alternative option?
User avatar
MarkDHamill
Registered User
Posts: 4243
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: Cookies being set to the wrong time?

Post by MarkDHamill »

Okay, I missed that this configuration variable had interface where it could be changed. In any event, what I observed was that when it was set to 0, the cookie expiration date did not change to 365 days. The cookie always expired at the current time.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Kindle and paper versions available.
Post Reply

Return to “[3.3.x] Support Forum”