silverstripe-framework/src/Security/MemberAuthenticator
Ingo Schommer 93b0884e19 BUG Lazy session state (fixes #8267)
Fixes regression from 3.x, where sessions where lazy started as required:
Either because an existing session identifier was sent through with the request,
or because new session data needed to be persisted as part of the request execution.

Without this lazy starting, *every* request will get a session,
which makes all those responses uncacheable by HTTP layers.

Note that 4.x also changed the $data vs. $changedData payloads:
In 3.x, they both contained key/value pairs.
In 4.x, $data contains key/value, while $changedData contains key/boolean to declare isChanged.
While this reduces duplication in the class, it also surfaced a bug which was latent in 3.x:
When an existing session is lazily resumed via start(), $data is set back to an empty array.
In 3.x, any changed data before this point was *also* retained in $changedData,
ensuring it gets merged into existing $_SESSION data.
In 4.x, this clears out data - hence the need for a more complex merge logic.

Since isset($this->data) is no longer an accurate indicator of a started session,
we introduce a separate $this->started flag.

Note that I've chosen not to make lazy an opt-in (e.g. via start($request, $lazy=false)).
We already have a distinction between lazy starting via init(), and force starting via start().
2018-07-19 13:32:04 +12:00
..
ChangePasswordForm.php API Refactor bootstrap, request handling 2017-06-22 22:50:45 +12:00
ChangePasswordHandler.php Update requesthandlers with missing extension points 2018-03-23 15:28:00 +13:00
CMSLoginHandler.php BUG Implement or exclude all pending upgrader deltas 2017-07-03 12:21:47 +12:00
CMSMemberAuthenticator.php BUG Implement or exclude all pending upgrader deltas 2017-07-03 12:21:47 +12:00
CMSMemberLoginForm.php Fixing string concat CS issues 2018-01-16 18:39:30 +00:00
CookieAuthenticationHandler.php FIX: Removed unnecessary database_is_ready call. 2017-08-25 13:06:12 +12:00
LoginHandler.php Update requesthandlers with missing extension points 2018-03-23 15:28:00 +13:00
LogoutHandler.php Revert "ENHANCEMENT Add config var to skip confirm logout (#7977)" 2018-04-04 13:51:18 +01:00
LostPasswordForm.php BUG Implement or exclude all pending upgrader deltas 2017-07-03 12:21:47 +12:00
LostPasswordHandler.php FIX remove personal information from password reset confirmation screen 2018-07-05 14:19:15 +12:00
MemberAuthenticator.php [SS-2018-010] Fix regression of SS-2017-002 2018-05-14 17:12:07 +12:00
MemberLoginForm.php BUG Fix double casting in login authenticator name 2018-01-22 14:06:24 +13:00
SessionAuthenticationHandler.php BUG Lazy session state (fixes #8267) 2018-07-19 13:32:04 +12:00