Share » Forums » Developer » Alternative to $user->lastVisit()...

Alternative to $user->lastVisit() with ezpSessionHandlerPHP

Alternative to $user->lastVisit() with ezpSessionHandlerPHP

Monday 14 March 2011 9:11:07 am - 3 replies

Author Message

André R.

Tuesday 15 March 2011 5:31:48 am

(re edit) Added your issue to the issue tracker here:

http://issues.ez.no/IssueView.php?Id=18144&activeItem=1

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

André R.

Tuesday 15 March 2011 5:59:35 am

Might have a patch for this to make sure eZUser does not update last visit ts:

diff --git a/lib/ezsession/classes/ezpsessionhandlerphp.php b/lib/ezsession/classes/ezpsessionhandlerphp.php
index 72c574e340a7c8158e19333bcf787e1edd7bc35a..cf199c8ac3996a640c6097874a311e8284f23121 100644
--- a/lib/ezsession/classes/ezpsessionhandlerphp.php
+++ b/lib/ezsession/classes/ezpsessionhandlerphp.php
@@ -28,6 +28,8 @@ class ezpSessionHandlerPHP extends ezpSessionHandler
         {
             ini_set("session.gc_maxlifetime", $ini->variable('Session', 'SessionTimeout') );
         }
+        // make sure eZUser does not update lastVisit on every request and only on login
+        $GLOBALS['eZSessionIdleTime'] = 0;
         return true;
     }
 

Edit: This issue has been fixed and commit is available here (for stable-4.4): https://github.com/ezsystems/ezpublish/commit/fdf56b18b35df841f232f9e1f4f8c43506fd0621

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Benjamin Lorteau

Tuesday 15 March 2011 6:54:52 am

This fix worked for me, and I'm using ezUser::updateLastVisit() to manually update the users' last visit timestamp.

Thanks a lot Andre !

(Topic marked as solved)

eZ Publish personal project : http://www.aeriesguard.com [fr]

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu