Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
user system
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
6 Mar 2013 at 03:57 UTC
Updated:
2 Oct 2014 at 20:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sunThis is what I'd propose — simply moves the code into the right spot.
Comment #3
neclimdulI would suggest leaving the automatic cookie domain detection and cleanup outside the session initialization so it can be used without creating a session. Its handy for setting your own cookies and sometimes that should happen outside of having a session.
Comment #4
sunAdding as a child to Symfony Session meta issue + the kernelize-bootstrap patch also touches this code in significant ways.
Comment #5
znerol commentedI just realized that we test
$request->cookies->has(session_name());in_drupal_bootstrap_page_cache(). Therefore I fear we cannot possibly defer setting thesession_name.Comment #6
sunHm. Good find!
However, the page_cache bootstrap phase comes after booting the kernel, so theoretically, it ought to be possible to consult a service (e.g. session_manager) to (1) set up the session name and (2) check whether the current request has a valid session?
That's not necessarily cookie based even... I wonder how this page cache construct in HEAD ever worked with alternative session + authentication implementations...?
→ In fact, shouldn't this page cache code actually consult the Authentication Manager to check whether any authentication provider returns that there is a valid user session?
The Cookie auth provider would in turn consult Session Manager, which needs to check whether the session cookie name matches the session name?
Comment #7
andypostIs the issue still valid?
Comment #8
sunYes, the code still exists, pretty much as before, just lives in
DrupalKernelnow.Theoretically, it should simply live on the
SessionHandlerorSessionManagerservice itself, but that ain't possible, because the session name is set up inDrupalKernel::bootEnvironment(), before a service container exists.That said, I don't know why it has to be set up that early. What's the use-case, if you can't use any services, including Authentication?
Comment #9
znerol commentedClosing this as a duplicate in favor of #2347877: Move DrupalKernel::initializeCookieGlobals() into a SessionConfiguration service. In addition the other will help with #2342593: Remove mixed SSL support from core.