Forum Moderators: coopster

Message Too Old, No Replies

strip sessions from url

         

ikbenhet1

8:59 am on May 7, 2004 (gmt 0)

10+ Year Member



Is there anything out there that can match and strip session id's from a url in php?

Robber

10:53 am on May 7, 2004 (gmt 0)

10+ Year Member



Could you use $_GET['PHPSESSID'] to extract it?

ikbenhet1

1:56 pm on May 7, 2004 (gmt 0)

10+ Year Member



i use curl to fetch these pages, i don't think i can can i?

coopster

2:46 pm on May 7, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



So you want to strip any session id variables from the query string prior to fetching the page?

ikbenhet1

2:47 pm on May 7, 2004 (gmt 0)

10+ Year Member



yes, please.

coopster

3:01 pm on May 7, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I guess it depends on where you are getting the url from in the first place. You are saying you have a url something along the lines of www.some-site.com?PHPSESSID=43lakfls4332asflsafj, and you are using it to retrieve a page via cURL. I guess you could use a regular expression on the url to extract only that information that is in front of the question mark in any given url string...?

DrDoc

3:02 pm on May 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just use the URL up until the question mark, and ignore the rest. That will successfully strip the session ID. Otherwise, there's no way of telling for sure (100%) if you're stripping the session ID or something else, unless you know what the session name is.

coopster

3:08 pm on May 7, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Exactly.