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.
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It only takes a minute to sign up.
Sign up to join this communityIs 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.
This my be useful to you, it describes how to use cURL with session cookies
https://stackoverflow.com/questions/13020404/keeping-session-alive-with-curl-and-php
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.
$_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, 2014 at 7:08