473,322 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

getting then session ID

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
Dec 7 '05 #1
2 1286
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
"PJ6" <no****@nowhere.net> wrote in message
news:ue****************@TK2MSFTNGP14.phx.gbl...
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

Dec 7 '05 #2
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

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:eA******************@TK2MSFTNGP10.phx.gbl...
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
"PJ6" <no****@nowhere.net> wrote in message
news:ue****************@TK2MSFTNGP14.phx.gbl...
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


Dec 7 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ronchese | last post by:
I'm noticing this since I started developing a website project: my session variables are getting empty! I did a real easy test, and I checked my session variable is getting empty!! What is...
4
by: preeti13 | last post by:
Hi friends i have a probelm i am try to pass the value to the employeeid parameter but getting th error please help me how i can do this i am getting the error here is my code using System;...
2
by: preeti13 | last post by:
Hi guys i am here with my another probelm please help me.trying insert the value into the data base but getting the null value error .I am getting thsi error Cannot insert the value NULL into...
3
by: tshad | last post by:
I have a file that I converted from VB.Net to C# that works fine in VB.Net when I compile but not in C# using the same libraries. The error I am getting is: PageInit.cs(9,7): error CS0138: A...
2
by: sony.m.2007 | last post by:
Hi, When i try to set a value for a session variable I'm getting a object refence not set error I tried two methods as below HttpContext.Current.Session.Add("AppStartTime", DateTime.Now);...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.