Sep 8, 2005 #1 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.
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.
Sep 8, 2005 1 #2 jemminger Programmer Jun 25, 2001 3,453 US nope. session ids exist server-side, javascript is client-side. -jeff http://www.jeffemminger.comtry { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); } i like your sleeves...they're real big Upvote 0 Downvote
nope. session ids exist server-side, javascript is client-side. -jeff http://www.jeffemminger.comtry { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); } i like your sleeves...they're real big
Sep 8, 2005 #4 adam0101 Programmer Jun 25, 2002 1,952 US 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 Upvote 0 Downvote
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