You should accept the session cookie, store it, and resend it on the next request.
Keeping session alive with Curl and PHP