The CreatorCon Call for Content is officially open! Get started here.

How Last login time works?

Josef Juna
Tera Expert

Hello Everyone,

 

I have a question. I need to understand how the "Last login time" in sys_user table works. So everytime when the user log in, something (and that is what I need to now) will trigger Login Event and then "Last Login time" script action is executed. Do anyone knows where exactly is the login event triggered? I tried to search for some gs.eventQueue('login, but I cannot find anything.

JosefJuna_0-1672756915631.pngJosefJuna_1-1672756952219.png

 

 

Thank for help in advance

1 ACCEPTED SOLUTION

Ah, like @Mohit Kaushik points out there are some actions that can be taken that will cause the last login date/time to be updated.

I have looked at adding an onBefore update BR that checks to see if last login is about to be update and if its because the user is being impersonated or not and some other things but decided it was just not worth it and just make sure people understand that its not the best measure of when someone logged in last.  Which is a bit frustrating.

View solution in original post

6 REPLIES 6

@Mohit Kaushik 

 

I know this post is fast approaching 2 years old, but along these lines (Last Login) do you know if email approvals also update the last login?

 

The use case I'm questioning - a member of management receives an email asking for an approval on a RITM, once approved, the platform shows that the Catalog Tasks were "opened by" that approving manager.  Even if the manager did the "approval" directly from email.

 

My assumption is that much like the "@" mention or Impersonation, this approval and subsequent catalog task generation would be updating the last login value.

 

Thanks!  Joh

@jstoessel I have never tried that but that could be the case. However, I would suggest you try it on your PDI or somewhere else just to verify if this is the only reason task is reflecting opened by as the approver. 

I would suggest taking a look at inbound email action which is working post approval through email, probably that is the culprit your case.

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)