Hi @Ahmed Salah Abed Elaziz
As AgaveJoe said, the issue relates the DateTime.Now.Ticks, when using JavaScript Date.parse method to convert the session value to the date time, it will show the "Invalid Date" error.
To solve this issue, you can try to remove the Tricks property, like this:
JS.InvokeVoidAsync("sessionStorage.setItem", "LastActivity", DateTime.Now.ToString());
Then, the result as below: after time out, it will redirect to login page:
[Note] when the page active, you need to reset the session storage.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion