Doube login issue

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
dib
Registered User
Posts: 2
Joined: Tue Aug 22, 2006 9:36 pm

Doube login issue

Post by dib » Tue Aug 22, 2006 10:02 pm

Hi:

I am having this peculiar issue when I am using phpbb.

When user tries to log in, his username/password is verified and he goes to the next screen. However, his username doesnt show up on the top right section of the screen and he is treated as an anonymous user. Surprisingly, if he logs in the second time, it works fine and he is treated as an authenticated user. The 2nd try always works.

Upon debugging, I realized that the following is happening:

1. It is retrieving the user_data correctly in session.php- session_begin() method.

2. Then it goes to index.php

3. session_pagestart() in session.php is called.

4. cookie check is successful but session id from cookie is not available. see code below...

5. Hence the following check fails...
// Does a session exist?
//
if ( !empty($session_id) )



-----------------------------------------------------------------------------------
Step 4 code:

if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )
{
$session_id = isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';
$sessiondata = isset($HTTP_COOKIE_VARS[$cookiename . '_data']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();
$sessionmethod = SESSION_METHOD_COOKIE;
...................
.................
It is going inside the if-condition but session id is not available...

User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun » Wed Aug 23, 2006 1:02 am

It's probably a case of where one page is using example.com and the other link is using the "www" in front of it. Changing your cookie settings to use .example.com should fix that, and allow folks to use the site with or without the "www" in front.

I think. :-)

Moving your post to phpBB Support for further help.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image

morestuff
Registered User
Posts: 816
Joined: Sun Aug 20, 2006 6:19 am

Post by morestuff » Wed Aug 23, 2006 1:48 am

bottom line is cookie settings are incorrect.

Auto Cookies MOD


Locked

Return to “2.0.x Support Forum”