Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Answered

How to get session ID through JavaScript?

Posted on by 162

SessionID.png

This might be a stupid question, but I cannot find answers from MS documents.

From JavaScript, how can I get the session ID as shown above?

Thanks a million,

Ning

  • Verified answer
    Ning Zhu Profile Picture
    Ning Zhu 162 on at
    RE: How to get session ID through JavaScript?

    It is in sessionStorage, pretty easy to read

           var storage = window.top.sessionStorage;

           var sessionId = storage.getItem("UNEXPECTED_TERMINATION");

    Hope, that can be useful to someone who are facing the same issue, sometime, sessionId will take 1 second to load, so add a timeout statement over will be a great idea

  • Guido Preite Profile Picture
    Guido Preite 54,074 Super User 2024 Season 1 on at
    RE: How to get session ID through JavaScript?

    I don't think there is a way (also unsupported) to get that value.

    Do you have a specific reason to have it? Technically should be the same as putting a GUID inside the sessionStorage (and I am not suggesting to do)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,888 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,247 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans