Getting Last Accessed DateTime from user profile

Hello …
Trying get “LastAccessedDateTime” from user Profile using function at Global Code :

// Get current user last access data
function CurrentUserLastAccessData()
{
    return Profile()->get("LastAccessedDateTime") ?? CurrentDate() ;
}

But I got empty string while there is a date and time value at user profile field , did I missed something ?
Thanx …

I was calling this function at PageLoad() , and then i try on PageRender() , works with me now , Thanx .