1
cesser
Last login times not updating
  • 2004/12/28 16:34

  • cesser

  • Just popping in

  • Posts: 26

  • Since: 2004/3/21


Hi all. I have 16 users registered on my XOOPS site and I have a block on the front page that displays the last login time for each user.

The problem I have is that about 30% of the last login times aren't updating when the users log in. I have at least 3 or 4 users that have logged in to my site over the last couple days (I've seen them in the Who's Online block), yet the last login time in their profile still shows a date of over a week ago.

Not sure what is going on here. It doesn't seem to be specific to any particular user, as sometimes, after a certain amount of days, the last login time WILL finally register a new login time for a user when he logs in. Obviously I would want it to update EVERY time the user logs in, but it isn't always happening.

Any ideas? Thanks in advance.

2
ackbarr
Re: Last login times not updating

are you using the auto-login hack? or long session times? cause if they do not actually log back in, the last login time does not update.

3
cesser
Re: Last login times not updating
  • 2004/12/28 17:15

  • cesser

  • Just popping in

  • Posts: 26

  • Since: 2004/3/21


I'm not using the auto-login hack (at least I don't think I am - I never applied any custom code to my installation).

The Session Expiration is set to 30 minutes (though I am not using Custom Sessions, so I don't think the Session Expiration applies). Should I be using custom sessions?

Anything else that could cause the last login date to not update?

4
Mithrandir
Re: Last login times not updating

Are you sure it is not just the Who's Online block that messes up? It is known for not being 100% accurate.

5
cesser
Re: Last login times not updating
  • 2004/12/28 17:42

  • cesser

  • Just popping in

  • Posts: 26

  • Since: 2004/3/21


The Who's Online block is accurate. There is a user on my site right now (showing in the Who's Online block), and he just posted on my forum in the last couple minutes.

However, his last login time still shows as 12/17/04

6
alitan
Re: Last login times not updating
  • 2004/12/28 18:18

  • alitan

  • Quite a regular

  • Posts: 399

  • Since: 2004/3/14


i suggest your to use the xmmemberstats module, it is accurate! the official who's online block doesn't work good,further more, I had a user who loged in a week before but it showed him!

7
cesser
Re: Last login times not updating
  • 2004/12/29 2:12

  • cesser

  • Just popping in

  • Posts: 26

  • Since: 2004/3/21


It's not the Who's Online block that I have a problem with. It's the actual last login time for each user. As I said, I've got users who have logged on today to my site, yet their last login time is shown as last week.

I don't have the auto login hack installed, and I am not using custom sessions. My problem is exactly like this thread (to which there was no answer):

https://xoops.org/modules/newbb/viewtopic.php?topic_id=16711&forum=2&post_id=116480#forumpost116480

Am I dead in the water here?

8
GIJOE
Re: Last login times not updating
  • 2004/12/29 5:01

  • GIJOE

  • Quite a regular

  • Posts: 265

  • Since: 2003/8/13


It looks like just a REFERER problem.
Do all of them install Norton?

Try xoops_refcheck() hack.

At least, my auto-login hack does not harm recording last login times.

9
cesser
Re: Last login times not updating
  • 2004/12/30 5:47

  • cesser

  • Just popping in

  • Posts: 26

  • Since: 2004/3/21


I applied the refcheck hack, still no go.

I appreciate all the help guys. Any more ideas?

10
wruckman
Re: Last login times not updating
  • 2005/11/15 0:04

  • wruckman

  • Just popping in

  • Posts: 1

  • Since: 2005/8/3 8


I had the same issue with my login times not updating. I figured out what the problem was for my site and i had to modify a few lines of code.

the first thing was that i wanted to have a secure login using ssl so i added the following to my user.php file.

$port $_SERVER['SERVER_PORT'];
if(
$port !== "443") {
header ("Location: https://mysite/xoopsdir/user.php");
}


This code indirectly caused the problem. basically i was forcing people to use a https page because it was encrypted. for some reason this causes issues with the last login being recored in the database from the checklogin.php file.

Removing that code fixed the last login issue, but left my site without ssl login.

in order to get the last login to work, and have my site ssl secured i found a way to change the post method of the system_userform.html template.

i went into templates in the admin console and went to system templates. i choose to edit the system_userform.html template to this:

<fieldset style="padding: 10px;">
  <
legend style="font-weight: bold;"><{$lang_login}></legend>
  <
form action="https://mysite/xoopsdir/user.php" method="post">
    <{
$lang_username}> <input type="text" name="uname" size="26" maxlength="25" value="<{$usercookie}>" /><br />
    <{
$lang_password}> <input type="password" name="pass" size="21" maxlength="32" /><br />
    <
input type="hidden" name="op" value="login" />
    <
input type="hidden" name="xoops_redirect" value="<{$redirect_page}>" />
    <
input type="submit" value="<{$lang_login}>" />
  </
form>
  <
a name="lost"></a>
  <
div><{$lang_notregister}><br /></div>
</
fieldset>

<
br />

<
fieldset style="padding: 10px;">
  <
legend style="font-weight: bold;"><{$lang_lostpassword}></legend>
  <
div><br /><{$lang_noproblem}></div>
  <
form action="lostpass.php" method="post">
    <{
$lang_youremail}> <input type="text" name="email" size="26" maxlength="60" />&nbsp;&nbsp;<input type="hidden" name="op" value="mailpasswd" /><input type="hidden" name="t" value="<{$mailpasswd_token}>" /><input type="submit" value="<{$lang_sendpassword}>" />
  </
form>
</
fieldset>


With the https as the post url, it will prompt for the certificate after hitting the login button transfer the info using ssl and saves the correct last login time in the database using the default method of calling the funtion in checklogin.php:

$user->setVar('last_login'time());


Hope this helps!

Login

Who's Online

181 user(s) are online (112 user(s) are browsing Support Forums)


Members: 0


Guests: 181


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits