ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Questions on last_visit/last_activity columns in exp_members

May 05, 2011 3:20pm

Subscribe [3]
  • #1 / May 05, 2011 3:20pm

    Matt Weinberg

    489 posts

    Hello,

    We were looking at the last_visit and last_activity columns in exp_members and can’t quite figure out how and when they get updated. Logging in/out multiple times and visiting various pages didn’t seem to consistently affect them in a pattern we can understand. Can you let me know the conditions under which these two columns get updated?

    Thanks so much,
    Matt

  • #2 / May 06, 2011 7:33am

    John Henry Donovan

    12339 posts

    Hi Matt,

    last_activity is written in the db at the start of a session. It is then updated every 5 minutes by default which may explain the inconsistency in your testing

    If the user has been inactive for longer than the session length EE will update their last_visit item so that it contains the last_activity date.  That way, EE can show the exact time they were last visiting the site.

    Take a look in system/codeigniter/system/libraries/Session.php for more on this

    Does that help?

  • #3 / May 06, 2011 12:31pm

    Matt Weinberg

    489 posts

    Thanks for your help, John Henry.

    Session length defaults to 2 hours, right?

  • #4 / May 08, 2011 2:13pm

    Greg Salt

    3988 posts

    Hi Matt,

    Correct. The default user session length is 2 hours and the default control panel session length is 1 hour.

    Cheers

    Greg

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases