Is it possible to retain the EE session when accessing a url in the same domain via cURL?

This is because the page accessed in the cURL call is dependent on EE's session variables.

  • 2
    This question appears to be off-topic because it is about php developing not really related to EE. cURL can do everything what regular person can do. Just need to use cURL with --cookie
    – Max Lazar
    Jun 4 '14 at 5:08
  • 1
    This is still EE related since I think EE's sessions are different from Native PHP Jun 12 '14 at 7:58

This my be useful to you, it describes how to use cURL with session cookies



So far as I'm aware you will need to do something special, Max alluded to being able to set a cookie. Without doing so your cURL request is seen as a totally separate session since it's initiated by your server, not by your browser.

  • It seems to me that you can access $_COOKIE['exp_sessionid'] to get the current sessionid. However, I still don't know how to make use of this information to retain EE session when using cURL. Jun 12 '14 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.