# How to distinguish between actual login and authentication

**URL:** <https://community.auth0.com/t/how-to-distinguish-between-actual-login-and-authentication/198824>\
**Category:** Get Help\
**Tags:** free-trial, login-experience\
**Created:** [April 10, 2026, 8:33am UTC](https://community.auth0.com/t/how-to-distinguish-between-actual-login-and-authentication/198824 "2026-04-10T08:33:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anna.jacobsen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/anna.jacobsen/32/72177_2.png) [@anna.jacobsen](https://community.auth0.com/u/anna.jacobsen)\
**Post date:** [April 10, 2026, 8:33am UTC](https://community.auth0.com/t/how-to-distinguish-between-actual-login-and-authentication/198824/1 "2026-04-10T08:33:28Z")

</div>

We have a case where we set a registration flag to true if the login\_count is 1. However, we have found that even if a user dont add their credentials to perform an actual login, e.g. their session is already stored as a cookie in the browser, and then they press our login button so we authenticate them again without making them write credentials, the login count is still 1 and then we registrate them again. Is there some way of distinguishing between the actual login sequence, and just authenticating them when they are sort of already logged in in auth0?

I saw someone writing that you could use event.transaction.protocol and event.request.query.prompt, but when i console log this in both cases (actual login and just authentication) both of the values above are the same. It seems like the event in the authentication is just the actual login event (when the count increased), as i verified by checking timestamps etc.

How can i find out in an action trigger that an event is the type of event that doesnt increase the login count, so i can seperate between the actual registration and the authentication that follows.

---

<div class="post-metadata">

**Author:** ![remus.ivan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/remus.ivan/32/68771_2.png) [@remus.ivan](https://community.auth0.com/u/remus.ivan)\
**Post date:** [April 10, 2026, 6:25pm UTC](https://community.auth0.com/t/how-to-distinguish-between-actual-login-and-authentication/198824/3 "2026-04-10T18:25:24Z")

</div>

Hi @anna.jacobsen,

Welcome to the Auth0 Community!

You have correctly identified that querying the `event.transaction.protocol` and `event.request.query.prompt` events does not provide the desirable outcome in this scenario, as the values can be both the same.

The recommended solution for this use case would be to utilize the **session information context** within a Post-Login Action by comparing the session authenticated timestamp - `event.session.authenticated_at` to the session update timestamp - `event.session.updated_at`. Please note that the session context is only available to enterprise subscriptions.

This article - [Differentiate User Logins From Session Reuse (SSO) in Post-Login Actions](https://support.auth0.com/center/s/article/differentiate-user-logins-from-session-reuse-sso-in-post-login-actions) provides more information on the matter, including action code snippets, as well as a workaround for non-enterprise customers.

I hope this helps, and if you have further inquires on the matter please let me know.  
Best regards,  
Remus

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 24, 2026, 6:25pm UTC](https://community.auth0.com/t/how-to-distinguish-between-actual-login-and-authentication/198824/4 "2026-04-24T18:25:39Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
