Sep 8, 2005 #1 EwS Programmer Joined Dec 30, 2002 Messages 398 Location 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 Joined Jun 25, 2001 Messages 3,453 Location 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 Thread starter #3 EwS Programmer Joined Dec 30, 2002 Messages 398 Location US Thanks. Upvote 0 Downvote
Sep 8, 2005 #4 adam0101 Programmer Joined Jun 25, 2002 Messages 1,952 Location 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