Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get session id with javascript 1

Status
Not open for further replies.

EwS

Programmer
Dec 30, 2002
398
US
When you open a browser window, a session id is created.
Is there a way to get this session id using only javascript?
Thank you.
 
nope. session ids exist server-side, javascript is client-side.

-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
Jeff is right. You'd have to use a server-side script to write it out to JavaScript. One example using ASP.NET:
Code:
<script language="JavaScript">
  var sessionId = '<%=Session.SessionID%>';
</script>
Or you could put a Literal control inside the single quotes and set the ".text" property to the session Id on Page_Load().

Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top