Last successful login date | Community
Skip to main content
shikhasoni1
Level 3
August 8, 2024
Solved

Last successful login date

  • August 8, 2024
  • 4 replies
  • 1606 views

Hi Folks, 

 

I have two requirements in which

 

1.I have to display last successful login time on the home page when a user logged in to the AEM based website. 

 

2.I have to display last successful login time on the logged in page when a user logged in to the AEM application (aem jar) itself. 

 

How can I achieve ? Please explain steps. 

 

Thankyou in advance

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by narendragandhi

Hi @shikhasoni1 

 

I am assuming you need this on the publish instance and you are on AEM as a Cloud Service. One option could be to store it in the user's profile as a custom attribute as @harwinder-singh mentioned above.

 

You would also need to make sure that the data synchronization and encapsulated token is enabled in the environment. https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/sites/authoring/personalization/user-and-group-sync-for-publish-tier#data-synchronization

 

Thanks

Narendra

4 replies

Harwinder-singh
Community Advisor
Community Advisor
August 8, 2024

@shikhasoni1 every time the user logs-in , you can add a custom property in the user's profile node. This property can store current login timestamp. Lets call it last-logon-date . Every time the user logs in, the following should happen and in that order (at the time of user login) : 

  1.  read the existing value of last-logon-date property value and set this in a cookie or in the session object. 
  2. After the above, update the last-logon-date with the timestamp of the current user login.

Hope this helps.

narendragandhi
Community Advisor
narendragandhiCommunity AdvisorAccepted solution
Community Advisor
August 8, 2024

Hi @shikhasoni1 

 

I am assuming you need this on the publish instance and you are on AEM as a Cloud Service. One option could be to store it in the user's profile as a custom attribute as @harwinder-singh mentioned above.

 

You would also need to make sure that the data synchronization and encapsulated token is enabled in the environment. https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/sites/authoring/personalization/user-and-group-sync-for-publish-tier#data-synchronization

 

Thanks

Narendra

Community Advisor
August 12, 2024

Refer to this post to understand the approach to capture last logged in time of the user in Author-https://medium.com/tech-learnings/adobe-experience-manager-reporting-on-users-last-login-date-e2035021cb9e?sk=1b8b8d9832fd096ba4946620249ba598

Please test this in your local or dev instance including exception cases before enabling on higher environment

Regards

Albin

https://myprofile.albinsblog.com

 

 

kautuk_sahni
Community Manager
Community Manager
August 14, 2024

@shikhasoni1 Did you find the suggestions helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni