469,295 Members | 1,991 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,295 developers. It's quick & easy.

How to remove session ids from url parameters using JS?

In our application, the URL is getting appended with some dynamic sessions. I am reading the URL paramteres using

var sNewUrl=document.location.pathname;

The above statement is also capturing the SESSIONID which is not required.

URL is-
http://yoursite.com/view/index.htmlSESSIONID=YyRMNv7D7BCh1G175lC5xnZlYfGGDT wjTzhJD52LpR1nxlvjNwLc!415886835!NONE

Can you please suggest me how to filter out the SESSION ID parameters after index.html using JS?

Appreciate relevant responses!
Mar 3 '11 #1
2 2271
8,651 Expert Mod 8TB
maybe var sNewUrl = document.location.pathname.split("?")[0]; works.
Mar 3 '11 #2
250 Expert 100+
If you have control of the php.ini file, you can configure php to not send session information in the url. Note that this will disallow sessions if the user has cookies turned off.
Mar 3 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Abhilash.k.m | last post: by
3 posts views Thread by msnews.microsoft.com | last post: by
9 posts views Thread by viz | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.