Cookies and Session ID - autologin does not work

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Anti-Spam Guide
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
slyd
Registered User
Posts: 7
Joined: Sat Oct 17, 2009 5:29 pm

Cookies and Session ID - autologin does not work

Post by slyd » Sat Oct 17, 2009 6:14 pm

Hello,

just converted from an old modded phpBB2 to a fresh unmodded phpBB 3.0.5 because my Hoster upgraded to php5.3, that worked fine.

The only very critical problem (really most annoying bug you can imagine):
:!: Autologin does not work - it did work flawlessly with the old phpBB2 since 4 years so it's for sure NOT a Client Computer Problem.
Cookie (and Server) settings are correct like described here:
http://www.phpbb.com/kb/article/fixing- ... -settings/

I also searched this and several other phpBB support Forums but found NO Solution.


:arrow: I guess the root of these Problems is this:
phpBB2 did NOT require SESSION IDs attached to the url, the new phpBB3 appends it like:
example.com/forum/index.php?sid=207330d26afb0db736bcd92419b4e424 :evil:


As soon as the session ID is removed from the URL - I am logged out. :cry:
Yes sure Cookies are accepted by my Browser and I manually checked that they are there.


phpbb.com/community does not require this.
Guess what? Yes! Auto login works fine here in this forum.
So how can I turn that Session ID mess off?

Also not good for bots and very very user unfriendly (just think of posting LINKs to a specific thread somehwere in the Forum by copy&paste :| :roll: )

Regards,
SlyD


PS:
There is a BUG in the language pack install - it should walk over alls subfolders(!) in the Folder /language but starts with the file(!!!) /language/index.htm. Then of course it fails as it checks an URL like /forum/language/index.htm/iso.txt
Deleting index.htm File in this Folder solved that problem but I think that should be fixed.
Last edited by darcie on Sun Oct 18, 2009 10:43 pm, edited 1 time in total.
Reason: Topic icon changed

User avatar
darcie
Community Team Member
Community Team Member
Posts: 5541
Joined: Thu Jul 27, 2006 9:52 am
Location: Davis, California
Name: Darcie Griffin
Contact:

Re: Cookies and Session ID - autologin does not work

Post by darcie » Sat Oct 17, 2009 6:38 pm

Session IDs are only kept in the URL if cookies are not working correctly. So let's see if we can get your board to set them appropriately.
Please Support Request Template Generator and post it back here to enable us to assist you better. Please also include your current cookie settings.
phpBB on Facebook | Site Rules | Former Community Team leader

slyd
Registered User
Posts: 7
Joined: Sat Oct 17, 2009 5:29 pm

Re: Cookies and Session ID - autologin does not work

Post by slyd » Sat Oct 17, 2009 7:38 pm

Thanks for your reply.
Forum is in a temporary test location and under reconstruction and I don't want to post the URL here before it's finished - if you need the URL write me a PM or Mail.

The forum is in a subfolder - location like example.com/forum
Cookie settings:
.example.com
blablubb12345
/
SSL disabled

I also tried
example.com
/forum
SSL enabled

and some other permutations of that.


What version of phpBB are you using? phpBB 3.0.5
What is your board's URL? if you really need the URL please write me a PM or Mail
Who do you host your board with? vip.nl
How did you install your board? I used the download package from phpBB.com
Is your board a fresh install or a conversion? Conversion from phpBB2
Do you have any MODs installed? Not yet
When did your problem begin? directly after install
Please describe your problem. Autologin does not work. s. Forum posting above
What styles do you currently have installed? custom modified, based on RedSilver3
What language(s) is your board currently using? DE, EN, NL, FR
Which database type/version are you using? MySQL 5.1.39
What is your level of experience? Comfortable with PHP and phpBB

+ PHP Version 5.3.1RC1 (our Hoster installed that one a week ago)
Do you need any other output of phpinfo?

Regards,
SlyD

User avatar
darcie
Community Team Member
Community Team Member
Posts: 5541
Joined: Thu Jul 27, 2006 9:52 am
Location: Davis, California
Name: Darcie Griffin
Contact:

Re: Cookies and Session ID - autologin does not work

Post by darcie » Sat Oct 17, 2009 10:10 pm

Got the URL from your PM.

The cookie settings appear to be correct for the moment as
.example.com
blablubb12345
/ (can also be /boardpath)
SSL disabled

On a whim... can you try switching to prosilver and see if the SID persists in the URL?
phpBB on Facebook | Site Rules | Former Community Team leader

slyd
Registered User
Posts: 7
Joined: Sat Oct 17, 2009 5:29 pm

Re: Cookies and Session ID - autologin does not work

Post by slyd » Sat Oct 17, 2009 10:27 pm

> / (can also be /boardpath)

Tried both already.

> try switching to prosilver

This also has no effect.

Maybe a Problem with PHP 5.3 ? Does anyone have a Board running on 5.3?

Regards,
SlyD

User avatar
darcie
Community Team Member
Community Team Member
Posts: 5541
Joined: Thu Jul 27, 2006 9:52 am
Location: Davis, California
Name: Darcie Griffin
Contact:

Re: Cookies and Session ID - autologin does not work

Post by darcie » Sat Oct 17, 2009 11:31 pm

I am unaware of issues with your PHP version, but anyone else feel free to chime in. :)

What settings do you have in Security settings for Session IP validation and Validate browser? Any change when these are altered?
phpBB on Facebook | Site Rules | Former Community Team leader

slyd
Registered User
Posts: 7
Joined: Sat Oct 17, 2009 5:29 pm

Re: Cookies and Session ID - autologin does not work

Post by slyd » Sat Oct 17, 2009 11:53 pm

I first used the standard settings, but turned off all security checking options for testing - did not change anything.
I also cleared cache several times and cleared the session and session_key tables in the Database using phpmyadmin.

--------
Other question - does anyone know what exactly in phpbb3 has been changed with cookie handling compared to phpbb2 ?
I mean, it worked great with phpbb2 and I've never seen a phpbb2 based forum with a session ID added to the URL...


Just checked a few of the links to the forums with problems in this 12 pages thread:
http://www.phpbb.com/community/viewtopi ... 5&start=45
nearly all of them still have session ID added to the URL as it seems at a first look :?


Don't get me wrong, phpBB is really great and there are lot's of very nice improvements in 3.0.5, but someone should really rework this cookie/login code in phpbb3 to get back phpbb2 stability... IMHO this is one of the most important features of a Forum.


Regards,
SlyD

ToonArmy
Former Team Member
Posts: 4608
Joined: Sat Mar 06, 2004 5:29 pm
Location: Worcestershire, UK
Name: Chris Smith
Contact:

Re: Cookies and Session ID - autologin does not work

Post by ToonArmy » Sun Oct 18, 2009 12:05 am

PM me your board address please.
Chris SmithBlogGitHub
Image
In a foreign field he lay. Lonely soldier unknown grave. On his dying words he prays. Tell the world of Paschendale.

ToonArmy
Former Team Member
Posts: 4608
Joined: Sat Mar 06, 2004 5:29 pm
Location: Worcestershire, UK
Name: Chris Smith
Contact:

Re: Cookies and Session ID - autologin does not work

Post by ToonArmy » Sun Oct 18, 2009 12:27 am

Missing a period before the cookie domain, example:

Code: Select all

.example.com
Chris SmithBlogGitHub
Image
In a foreign field he lay. Lonely soldier unknown grave. On his dying words he prays. Tell the world of Paschendale.

slyd
Registered User
Posts: 7
Joined: Sat Oct 17, 2009 5:29 pm

Re: Cookies and Session ID - autologin does not work

Post by slyd » Sun Oct 18, 2009 12:46 am

As I already wrote above (yes I read that KB article - s. link in my first posting!)
I tested it WITH and without period as first character and permuted through several different setting combinations. Did not change anything. :|

ToonArmy
Former Team Member
Posts: 4608
Joined: Sat Mar 06, 2004 5:29 pm
Location: Worcestershire, UK
Name: Chris Smith
Contact:

Re: Cookies and Session ID - autologin does not work

Post by ToonArmy » Sun Oct 18, 2009 1:21 am

Apologies, the value you had was incorrect. Now you have the correct cookie domain, and it still doesn't work obviously something else is amiss. I suspect it is down to the new version of PHP. Could you upload a PHP script to your server with the following contents:

Code: Select all

<?php
phpinfo(); 
PM me the URL to the file.
Chris SmithBlogGitHub
Image
In a foreign field he lay. Lonely soldier unknown grave. On his dying words he prays. Tell the world of Paschendale.

User avatar
T0ny
Registered User
Posts: 1383
Joined: Sun Jan 29, 2006 8:42 pm
Location: Lancashire
Name: Tony

Re: Cookies and Session ID - autologin does not work

Post by T0ny » Sun Oct 18, 2009 10:26 am

PHP 5.3 introduced a new configuration option request_order. If this is set to "GP" (which appears to be the value used by most hosts) it will remove cookie values from the super global $_REQUEST , which will break phpbb's session handling. If this is the problem, and your host allows you to override PHP setting (e.g. with an .htaccess file) you could set it to "GPC" to fix the problem.

slyd
Registered User
Posts: 7
Joined: Sat Oct 17, 2009 5:29 pm

Re: Cookies and Session ID - autologin does not work

Post by slyd » Sun Oct 18, 2009 10:56 am

:idea: Indeed, it was set to GP.
I changed it to GPC now it works! :D
Thanks for that hint.

I use the following settings now:

php_flag register_globals On
php_flag magic_quotes_gpc On
php_value request_order GPC

Btw.
Should register_globals and magic_quotes_gpc be On or Off for phpBB3 ?

Regards,
SlyD

PS: I think someone should add that info to the KB Article as it may be an issue for many users as soon as their hosters upgrade to recent PHP Versions.

ToonArmy
Former Team Member
Posts: 4608
Joined: Sat Mar 06, 2004 5:29 pm
Location: Worcestershire, UK
Name: Chris Smith
Contact:

Re: Cookies and Session ID - autologin does not work

Post by ToonArmy » Sun Oct 18, 2009 11:21 am

slyd wrote:Should register_globals and magic_quotes_gpc be On or Off for phpBB3 ?
Off, very much off!
T0ny wrote:PHP 5.3 introduced a new configuration option request_order.
Cheers, I couldn't find it in the 5.3 migration guide. I knew it was something like this.
Chris SmithBlogGitHub
Image
In a foreign field he lay. Lonely soldier unknown grave. On his dying words he prays. Tell the world of Paschendale.

slyd
Registered User
Posts: 7
Joined: Sat Oct 17, 2009 5:29 pm

Re: Cookies and Session ID - autologin does not work

Post by slyd » Sun Oct 18, 2009 11:32 am

OK so as solution for everyone - add this:

Code: Select all

php_flag register_globals Off
php_flag magic_quotes_gpc Off
php_value request_order GPC
to the .htaccess file in the Forum root directory to make it work with php 5.3

Thanks again,
SlyD

Locked

Return to “[3.0.x] Support Forum”