A
A
Alexander2015-09-06 13:05:12
PHP
Alexander, 2015-09-06 13:05:12

Why might a session cookie be set?

Subject.
In more detail, the essence is as follows: the cookie is set using the standard setcookie.

setcookie($name, $value, $time, $folder, $domain, $secure);

$time is exactly the time in the future, checked repeatedly. And the server time is also in the future. In general, it turns out to be the usual time () + 86400 * 366. But the cookie arrives in the browser without expire and is accordingly set as session. Interestingly, not all cookies from this site are set this way. It seems that somewhere in the process of execution, there is some command that switches some parameter, which leads to the fact that cookies fly away without time to the browser.
Perhaps not PHP is to blame, but apache or nginx. Are there any settings that would make them do something similar?
The most interesting thing is that some clients leave normally, and some do not:
To me:
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:keep-alive
Content-Length:56698
Content-Type:text/html; charset=UTF-8
Date:Sun, 06 Sep 2015 15:00:55 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
P3P:policyref="/bitrix/p3p.xml", CP="NON DSP COR CUR ADM DEV PSA PSD OUR UNR BUS UNI COM NAV INT DEM STA"
Pragma:no-cache
Proxy-Connection:keep-alive
Server:nginx/1.2.4
Set-Cookie:test1=1; path=/; domain=domain.ru
X-Powered-By:PHP/5.3.3

And this is the service www.rexswain.com
HTTP/1.1 200 OK
Server: nginx/1.2.4
Date: Sun, 06 Sep 2015 14:58:18 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: close
X-Powered-By: PHP/5.3.3
Set-Cookie: test1=1; expires=Wed, 07-Sep-2016 14:58:17 GMT; path=/; domain=domain.ru
P3P: policyref="/bitrix/p3p.xml", CP="NON DSP COR CUR ADM DEV PSA PSD OUR UNR BUS UNI COM NAV INT DEM STA"
X-Powered-CMS: Bitrix Site Manager (80161cf30f7af608287b8d9baedc4cd7)
Set-Cookie: PHPSESSID=20v86dsj2sn4kmid79n544c132; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: BITRIX_SM_CITY_NAME=%D0%9F%D1%80%D0%BE%D0%B2%D0%B8%D0%B4%D0%B5%D0%BD%D1%81; expires=Sat, 26-Aug-2017 14:58:17 GMT; path=/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Teterin, 2015-09-22
@errogaht

Do you use any services to speed up/cache the site? They can change titles easily.
In both examples, a cookie is set. Bitrix is ​​the same as a bottomless black box, who knows what it does there ...
Try to put a cookie in a separate file without Bitrix.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question