cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Community Member

last_login vs last_request

Jump to solution

We're exploring login data and I am curious what the difference is between last_login and last_request from the pseudonym_dim table. There are some big gaps in the dates sometimes (e.g. last_login = April 11, 2016 while last_request = May 7, 2016 for a given pseudonym). Does this indicate that a user logged in on April 11th and somehow managed to keep an active session going for several weeks, with the most recent activity on May 7th? Or am I way off base here? Any guidance on how to interpret login/user/pseudonym data would be great. Thanks!

1 Solution

Accepted Solutions
Highlighted
Instructure
Instructure

Hello Everyone,

Was just notified of this post by another school. Hopefully I can shed some light into why you may be seeing a large difference between last_login and last_request.

The most immediate example that comes to mind is mobile sessions. When a user first logs into the mobile app, it creates a session that will persist forever until they uninstall the app, or explicitly log out. You can hopefully see now how this large gap can easily occur.

Another example of a long standing session may also be a user who has never closed the Canvas tab within their browser. We do not force people out of the system (banks do this by automatically redirecting you to login page), but rather wait for their next request to the system to verify the authentication. This also could result in a session seeming to span a day or more. Just as a note, the default Canvas Authentication session is set at 24 hours.

Please let me know if you have further questions about this.

Thank you!

View solution in original post

0 Kudos
5 Replies
Highlighted
Community Member

Hello,

I share your confusion, but Instructure (in the schema) says that the description of "last_request_at" is "TBD," so the schema is not of much help here. I do think that the value in "last_request_at" is related to the most recent session, which is stored in "current_login_at" and not "last_login_at." I don't know why "last_login_at" is in the database unless you want to determine the period between the two most recent sessions.

Sam

Highlighted
Community Member

Thanks for the reply. I think you're right that current_login_at gets us closer to the most recent activity. After some convo around this at InstructureCon, it sounds like last_login_at might be the last time someone entered their login credentials and physically clicked the login button, while current_login_at is tied to the most recent session. In the mobile app, for example, a user only logs in once, so last login shows that inital login, but each subsequent login updates the current_login_field. last_request_at seems like the best place to find most recent activity.

Highlighted
Community Member

Hello,

We have been trying to grasp this concept as well.  Comparing all the places the login data comes from it is clear to me that last user access is typically the most up to date.  However, it has been explained to me that last login refers to the last time a student authenticated in the system while last enrollment activity records the last time a request was made in the system given five minute intervals.  Looking at the requests table you can sort new - old for "Timestamp" and see the request to the seconds so..... 

The other thing I see is that last user access is usually the most up to date compared to all the other options which should not be the case.  What is really strange is that there are isolated cases where the last login is days before a submission date.  Could be a delay in the process of identifying the submission or instructor action but again that should not be the case.

In short, I am a little confused as well.

Highlighted
Instructure
Instructure

Hello Everyone,

Was just notified of this post by another school. Hopefully I can shed some light into why you may be seeing a large difference between last_login and last_request.

The most immediate example that comes to mind is mobile sessions. When a user first logs into the mobile app, it creates a session that will persist forever until they uninstall the app, or explicitly log out. You can hopefully see now how this large gap can easily occur.

Another example of a long standing session may also be a user who has never closed the Canvas tab within their browser. We do not force people out of the system (banks do this by automatically redirecting you to login page), but rather wait for their next request to the system to verify the authentication. This also could result in a session seeming to span a day or more. Just as a note, the default Canvas Authentication session is set at 24 hours.

Please let me know if you have further questions about this.

Thank you!

View solution in original post

0 Kudos
Highlighted
Community Member

From what I've gather during this last Instructurecon (Hack Night), community posts, and my own testing, here are definitions for the following fields:

  • The last_activity_at field in the ENROLLMENT table indicates the last time a user viewed content or took action in a course. This includes any pings made to the survey while a course page is open in the browser (even if there was no user activity, mouse movements, etc.).
  • The last_login_at field in the PSEUDONYM table indicates the last time a user actually navigated through the login process in the mobile app or the website.
  • The last_request_at field in the PSEUDONYM table indicates the last time a ping to the server took place from a user's account.
  • The current_login_at field in the PSEUDONYM table indicates the time the most recent session was started by a user.

Can anyone confirm these descriptions - the definitions in the Canvas Documentation is vague. Also, I think all of these now work in the mobile apps too, is this correct?

UPDATE 8/6/2018: I was able to confirm these definitions with Canvas Support.