Ewa.Workbook.getSessionId()

Last modified: June 14, 2011

Applies to: apps for SharePoint | SharePoint Server 2010

In this article
Return Value
Remarks
Example
Applies To

Gets the session identifier.

var value = Ewa.Workbook.getSessionId();

The Ewa.Workbook.getSessionId method returns the session ID for the user session.

The following code example shows how to display the session ID in the browser status bar after the page loads.

<script type="text/javascript">
     
var ewa = null;
    
// Add event handler for onload event.
if (window.attachEvent) 
{ 
    window.attachEvent("onload", ewaOmPageLoad);    
} 
else 
{ 
    window.addEventListener("DOMContentLoaded", ewaOmPageLoad, false); 
}

// Add event handler for applicationReady event.
function ewaOmPageLoad() 
{         
    Ewa.EwaControl.add_applicationReady(getEwa); 
} 

function getEwa()
{            
    // Get a reference to the Excel Services Web Part.
    ewa = Ewa.EwaControl.getInstances().getItem(0);    
     
    // Display session ID in browser status bar.
    window.status =  "The session ID is " + ewa.getActiveWorkbook().getSessionId() + ".";                                
}              
      
</script>

Show: