getting then session ID

P

PJ6

Is is possible to get the session ID in JavaScript when using ASP.NET in
cookieless mode?

The reason I ask is that one of the functions I want to perform using remote
scripting (AJAX) is a page location redirect. When the session is cookieless
I want to respect the session ID contained in the current URL.

Paul
 
K

Karl Seguin

Isn't it a simple mater of parsing the path information?

var path = window.location.pathname;
var sessionId = path.substring(path.indexOf("(")+1, path.indexOf(")"));

will work so long as none of your paths' use ( or )

Karl
 
P

PJ6

I wanted to avoid that for that very reason...

But now that I think about it indexOf returns the first occurance in a
string. I don't think I'll have anything to worry about since the SessionID
comes before everything except the site name.

Thanks,
Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top