My cookie file are getting "reseted"

Alexander Soteras <[email protected]> Tue, 8 Sep 2015 18:53:29 +0200
Newsgroups gmane.comp.web.curl.php
Message-ID <CACc-MHpfRTtEVwiTJs1ySPiv58mdQKtJwyhBsNhc6Hs2Fgcxcg@mail.gmail.com>
--===============1196213344==
Content-Type: multipart/alternative; boundary=001a11c3421ca25953051f3f3469

--001a11c3421ca25953051f3f3469
Content-Type: text/plain; charset=UTF-8

Hello,

I have a specific set up in PHP where I have wrapped a legacy PHP
application with Symfony, and all access to this legacy application go
through cURL. *(I have posted my code on a stackoverflow topic to avoid
doing a copy/paste of the code here,
http://stackoverflow.com/questions/32456400/curl-reset-my-cookies-file
<http://stackoverflow.com/questions/32456400/curl-reset-my-cookies-file>)*.

I have configured the whole thing to keep session alive with a single
cookie file per user to store session data. Everything's working fine, the
cookies file are getting updated with every session data, but my users are
getting randomly disconnected from their sessions, and they have to log in
in the application again.

When it does that, I have noticed that the cookie file is "reset", all the
data is removed and I got a new phpssid.

What would cause the cookie file to behave like that ? The whole
application is "redirected" using cURL, that mean every script, images and
such, could that cause the issue ? Could a request with an empty header
could force cURL to "clear" the cookie file, as the cookie is being written
at every request ?

From my understanding, the command CURLOPT_COOKIEJAR specify the file where
the cookie data is stored :

- If this file doesn't exist, it create it.
- On every cURL request, it write data inside it, but it never remove any
data.

I'm getting desperate here, thanks !

Alexander

--001a11c3421ca25953051f3f3469
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div><div><div>Hello,<br><br></div>I have a specific =
set up in PHP where I have wrapped a legacy PHP application with Symfony, a=
nd all access to this legacy application go through cURL. <b>(I have posted=
 my code on a stackoverflow topic to avoid doing a copy/paste of the code h=
ere, <a href=3D"http://stackoverflow.com/questions/32456400/curl-reset-my-c=
ookies-file">http://stackoverflow.com/questions/32456400/curl-reset-my-cook=
ies-file</a>)</b>.<br><br></div>I have configured the whole thing to keep s=
ession alive with a single cookie file per user to store session data. Ever=
ything&#39;s working fine, the cookies file are getting updated with every =
session data, but my users are getting randomly disconnected from their ses=
sions, and they have to log in in the application again. <br><br></div>When=
 it does that, I have noticed that the cookie file is &quot;reset&quot;, al=
l the data is removed and I got a new phpssid.<br><br></div>What would caus=
e the cookie file to behave like that ? The whole application is &quot;redi=
rected&quot; using cURL, that mean every script, images and such, could tha=
t cause the issue ? Could a request with an empty header could force cURL t=
o &quot;clear&quot; the cookie file, as the cookie is being written at ever=
y request ?<br><div><div><div><br></div><div>From my understanding, the com=
mand CURLOPT_COOKIEJAR specify the file where the cookie data is stored :<b=
r><br></div><div>- If this file doesn&#39;t exist, it create it.<br></div><=
div>- On every cURL request, it write data inside it, but it never remove a=
ny data. <br><br></div><div>I&#39;m getting desperate here, thanks !<br><br=
></div><div>Alexander<br></div><div><br></div></div></div></div>

--001a11c3421ca25953051f3f3469--

--===============1196213344==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaHR0cDovL2Nv
b2wuaGF4eC5zZS9jZ2ktYmluL21haWxtYW4vbGlzdGluZm8vY3VybC1hbmQtcGhwCg==

--===============1196213344==--