Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
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,081 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans