Jump to content

[SOLVED] curl and saving sessions


chick3n

Recommended Posts

basically when i use curl to grab a webpage, all the a href's contain session id's

 

ex: ?s=2832832 or jsession=2231231 etc

Is there any option to remove that?

 

If you go with IE or FF and goto view source, that data doesnt exist.

 

Link to comment
Share on other sites

check out this article, it will probably get you all the way there:

 

http://www.frozenminds.com/disable-sessionid.html

 

I dont want to remove session ID's from my own server, the problem is when using CURL to return the web contents of another site it is attaching session ID's to the URL's, and for now i use a preg_replace to remove the session id's but i want to know if there is a way to do it through CURL itself, because with browsers when you goto a webpage you dont see the session IDs in the URL itself so how is it getting rid of them? Does it have to do with cookies maybe?

Link to comment
Share on other sites

The only time session IDs are appened in the URL is when cookie support isn't allowed server side or client side. Set up your curl requests to use cookies.

 

Ive added

curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile); 
    curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);

and it seems to have sold it, thx.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.