नोट
इस पेज तक पहुँच के लिए प्रमाणन की आवश्यकता होती है. आप साइन इन करने या निर्देशिकाओं को बदलने का प्रयास कर सकते हैं.
इस पेज तक पहुँच के लिए प्रमाणन की आवश्यकता होती है. आप निर्देशिकाओं को बदलने का प्रयास कर सकते हैं.
यह इवेंट क्लाइंट द्वारा आह्वान किया है जब एक सत्र बंद है। यह इवेंट क्लीन-अप कार्य करने या सत्र बंद करने के जवाब में अनुप्रयोग स्थिति को अद्यतन करने का अवसर प्रदान करता है। ON_SESSION_CLOSED इवेंट निम्न eventData लेता है:
| इवेंटडेटा | विवरण |
|---|---|
| सत्र आईडी | सत्र की सत्र ID जो बंद थी. |
उदाहरण
// Define a handler function that's triggered when a session is closed
let sessionClosedHandlerFunction = function(eventInput) {
// Log the ID of the closed session to the console
console.log("Session closed: " + eventInput.data.sessionId);
};
// Retrieve the event topic specific to session closing from the API
let sessionCloseTopic = Microsoft.Apm.getEventPublisherTopic("ON_SESSION_CLOSED");
// Create a new broadcast channel to subscribe to session close events
let sessionCloseSubscriber = new BroadcastChannel(sessionCloseTopic);
// Attach the session closed handler function to the message event of the subscriber
sessionCloseSubscriber.onmessage = sessionClosedHandlerFunction;
नोट
कोड नमूना ब्रॉडकास्ट चैनल API - वेब API का उपयोग करता है, जो विभिन्न दस्तावेज़ों जैसे कि समान मूल के पृष्ठों या iframes के बीच संचार करने के लिए है। सुनिश्चित करें कि यह आपके अनुकूलन के अनुकूल है क्योंकि इस एपीआई के लिए समर्थन भिन्न हो सकता है।