forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: Tonyvic on June 29, 2011, 10:43:07 am

Title: Need to enter login details twice
Post by: Tonyvic on June 29, 2011, 10:43:07 am
Hi,
I have upgraded my gallery from 1.4 to 1.5.12 and since then when some members (About 25%) enter their login details click 'OK' they are taken back to the login screen again. On entering their details a second time they get logged in ok.
The members with the problem have a range of OS & Browsers so it's not any one in particular.

The Gallery is at http://www.naturist-corner.co.uk/gallery/login.php (http://www.naturist-corner.co.uk/gallery/login.php) but it's for registered members only & is not suitable for work computers.

Many thanks for any help.

Tony
Title: Re: Need to enter login details twice
Post by: Αndré on June 29, 2011, 12:13:46 pm
Please provide a test user account, so we can test it ourselves.
Title: Re: Need to enter login details twice
Post by: Tonyvic on June 29, 2011, 02:05:42 pm
Andre,
Sorry I posted in the wrong board & thanks for moving it.

Username = Test
Password = cmgteam

Many thanks,
Tony
Title: Re: Need to enter login details twice
Post by: Αndré on June 29, 2011, 02:56:31 pm
some members (About 25%) enter their login details click 'OK' they are taken back to the login screen again. On entering their details a second time they get logged in ok.
Did you speak to that users or do you just conclude that from the logs? I just tested it three times and get logged in successfully each time. Maybe I'm one of the 75%, but I cannot see anything odd at the first glance.
Title: Re: Need to enter login details twice
Post by: Tonyvic on June 29, 2011, 03:26:01 pm
I have spoken to my co-administrators and three users who have the problem, they all say the screen refreshes when they click 'ok' but then the 'Username' & 'Password' are gone. Then then add their details again & click 'ok' and this time they get in.
I have three accounts (1 Admin & 2 User) in that Gallery and I have never had that problem, since I upgraded it some months ago.

I upgraded my other Gallery yesterday from 1.4.19 to 1.5.12, now my co-admins report they have the same problem with that one but didn't before.

(I have just looked at the 'access log file, out of 27 recent logins 8 had to do it twice).

Tony
Title: Re: Need to enter login details twice
Post by: Phill Luckhurst on July 02, 2011, 07:55:15 pm
Does the same occur if you use the default curve theme?
Title: Re: Need to enter login details twice
Post by: Tonyvic on July 04, 2011, 08:06:14 pm
I have changed to the default 'Curve' theme. The same problem still but I have just learned that when they first go to the gallery's URL they get
Quote
Warning your browser does not accept script's cookies
.
That goes after the first login attempt, or if the page is refreshed before entering their details.
The browsers of those I'm in contact with are set to 'accept third party cookies'!

Tony
Title: Re: Need to enter login details twice
Post by: Αndré on July 13, 2011, 03:13:22 pm
Not sure if that's a fault of Coppermine, Inspekt or the browser. But I noticed the following:
1.) Clear your cookies (at least the cookies for your domain)
2.) Open login.php directly
3.) You'll see the red cookie warning message, because the Coppermine 'data' cookie doesn't exist (at least the script hasn't found it):
Code: [Select]
if (!$superCage->cookie->keyExists($CONFIG['cookie_name'] . '_data')) {
    $cookie_warning = <<<EOT
                  <tr>
                      <td colspan="2" align="center" class="tableh2">
                          <span style="color:red"><strong>{$lang_login_php['cookie_warning']}</strong></span>
                      </td>
                  </tr>

EOT;
}
4.) Open login.php a second time, the message disappears, as the cookie exists
5.) Login should work as expected


If you visit your gallery the 'normal' way (i.e. don't use login.php, but index.php), you'll automatically redirected to login.php, but the cookie has already been created. As a workaround tell your users that they have to update their bookmarks to not use login.php.


I'll have a closer look at this soon.
Title: Re: Need to enter login details twice
Post by: Αndré on July 13, 2011, 03:35:12 pm
Okay this seems to be the usual behavior:
Quote from: http://de2.php.net/manual/en/function.setcookie.php
Once the cookies have been set, they can be accessed on the next page load
Title: Re: Need to enter login details twice
Post by: Tonyvic on July 15, 2011, 08:21:15 pm
Many thanks Andre,
Changing the link so members start at index.php & not login.php has corrected the problem for those that have so far tested.
What is still a mystery is that the link to my Gallery has not changed since before the upgrade to 1.5, but this didn't occur before. :-\

Tony
Ps. I consider the problem solved, but cannot find the Icon to tick. Sorry.

Title: Re: Need to enter login details twice
Post by: Αndré on July 15, 2011, 09:14:00 pm
Ps. I consider the problem solved, but cannot find the Icon to tick. Sorry.

Seems that we have to apply some more changes after the upgrade to SMF2 ;) No worry, that icon is currently not available.
Title: Re: Re: Need to enter login details twice
Post by: lurkalot on July 15, 2011, 10:58:31 pm
Seems that we have to apply some more changes after the upgrade to SMF2 ;) No worry, that icon is currently not available.

Sorry to hijack this thread, but it's kind of relevant.    Tonyvic, can you now see the "Topic Solved" button on the bar at the bottom of the page?  I believe it wasn't available to regular users, but it should be now.

If yes, could you click it please.
Title: Re: Need to enter login details twice
Post by: Tonyvic on July 15, 2011, 11:22:43 pm
I'm afraid not!

Tony
Title: Re: Need to enter login details twice
Post by: Joe Carver on July 15, 2011, 11:36:35 pm
What is still a mystery is that the link to my Gallery has not changed since before the upgrade to 1.5, but this didn't occur before....
It has been "normal" behavior since 1.5.8 anyway.


To return your user's bookmarks to login.php - edit login.php.
Find as shown above:
Code: [Select]
<span style="color:red"><strong>{$lang_login_php['cookie_warning']}</strong></span>
Add below it:
Code: [Select]
<br />
<span style="color:red"><strong><a href="login.php">SET YOUR COOKIE - CLICK HERE</a></strong></span>

Or something similar as you wish.
Title: Re: Need to enter login details twice
Post by: lurkalot on July 15, 2011, 11:50:04 pm
I'm afraid not!

Tony

It should be on the left hand side at the bottom.  I just logged in on a test account, and it was there, I got this screengrab from it.
Title: Re: Need to enter login details twice
Post by: Tonyvic on July 15, 2011, 11:59:32 pm
Many thanks Joe.
As I have changed the link in my forum for members to use, I will incorporate your suggestion when next upgrading.

It should be on the left hand side at the bottom.  I just logged in on a test account, and it was there, I got this screengrab from it.
Quite right Andre, maybe my eyesite is failing. ;D

Tony
Title: Re: Need to enter login details twice
Post by: Αndré on July 16, 2011, 09:46:43 am
Quite right Andre, maybe my eyesite is failing. ;D
Seems so, as the post you answered to was from lurkalot ;D
Title: Re: Need to enter login details twice
Post by: Tonyvic on July 16, 2011, 12:41:03 pm
Thanks for correcting me Andre. :-[
Sorry lurkalot, must go to Specsavers. 8)

Tony
Title: Re: Need to enter login details twice
Post by: Αndré on August 01, 2011, 11:23:55 am
Added workaround for initial issue in svn revision 8228.
Title: Re: Need to enter login details twice
Post by: Αndré on October 13, 2011, 02:58:27 pm
Fixed possible infinite loop in svn revision 8268.