-
Notifications
You must be signed in to change notification settings - Fork 9
Question about session cache response header #10
Comments
I think that's probably a good idea, and may explain some issues I've seen when using this package. If we do this, what header(s) should we add? The |
Hello @weierophinney , I believe we should add the specific header just based on the current (pre-session-start) ini value of Any custom cache limiter setting added via configuration before the pipeline is started would then be used like ext-session always did, but with a response header added by the persistence object. So it is just a change of responsibility (who's sending it) not of behaviour. (I found it strange that you had problems though, since whether you are using php-session or this package, that (EDITED!!!cookie!!!NO, I MEANT =>) header is always sent (unless you are referring to headers already sent issues as in cli sapi). "php"'s default generic assumption is to send cache (or better I honestly never had the need to customize that value before and the utility function is very thorough https://github.com/php/php-src/blob/master/ext/session/session.c#L1095, but i believe that this package should just create and inject the header without adding any other specific tool, at least for now... To keep it simple I see no reason for now to add custom kind regards, |
The issue I was having is that the cookie would expire every day, despite having set a largish session.lifetime value... which, when I look at the source code now, we never pass on to the cookie we're creating. So that's a separate issue. |
...the session-name cookie? if (empty($this->cookie)) {
//...add the session-name cookie header to if (empty($this->cookie)) {
$this->cookie = session_id(); // (..)_id of course....
}
// add the session cookie header if $this->cookie === session_id() is not empty (edited) ? (edited) header ('Location: /new-url'); instead of returning a redirect response.... |
The cache header generation is actually a bit less trivial:
|
@weierophinney
was meant to be
and i was referring to the automatically added cache header |
Update: I am trying to build the functionality for intercepting the cache_limiter and add the cache headers to the response by inspecting the php-src: I juts found-out that the Last-Modified header is actually the GMT modified time of the running script: https://github.com/php/php-src/blob/PHP-7.1.17/ext/session/session.c#L1090 |
this could be the first step of a possible implementation: #12 |
Hello,
in my tests as soon as
session_start()
is called, a response cache header is added, even ifuse_cookies
is disabled. (I got the header already sent error while unit testing a project not based on expressive, but then I checked the response header of the skeleton application + session-ext and I noticed that a Pragma: no-cache header was automatically set)Does this happen to anybody else?
Should we call
session_cache_limiter(null)
and programmatically add that header as it's already done for the session id cookie?kind regards,
maks
The text was updated successfully, but these errors were encountered: