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)
Could you use $_GET['PHPSESSID'] to extract it?
ikbenhet1
1:56 pm on May 7, 2004 (gmt 0)
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)
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)
yes, please.
coopster
3:01 pm on May 7, 2004 (gmt 0)
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)
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.