# Should sessions override user sent headers?

- Thread: https://externals.io/message/66486
- Original archive: https://news-web.php.net/php.internals/66486
- Started by Nikita Nefedov on 2013-03-06T10:11:58+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #66486 — Nikita Nefedov — 2013-03-06T10:11:58+00:00

URL: https://externals.io/message/66486#66486

Hi,

so I stumbled upon this bug report: https://bugs.php.net/bug.php?id=64357

It's fairly easily fixable, but I don't know if it's even a bug... The  
problem here: sessions always send Expire header (except for  
private_no_expire), so if user (php user) sent Expire header before  
 `session_start()` call, it will be replaced (see  
https://github.com/php/php-src/blob/master/ext/session/session.c#L1066 and  
ADD_HEADER macros for example).

---

## #66515 — Stas Malyshev — 2013-03-07T08:37:23+00:00

URL: https://externals.io/message/66486#66515 · In reply to: #66486

Hi!

> so I stumbled upon this bug report: https://bugs.php.net/bug.php?id=64357
> 
> It's fairly easily fixable, but I don't know if it's even a bug... The  

Well, the result in the bug is obviously wrong - it should have one
date, or another date, but not both! I'd say if you explicitly set the
Expires, it should override the session one. In general, later one
should override previous one.

-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
