Skip to content

Only trap E_ERROR in session handling - #28464

Merged
skjnldsv merged 1 commit into
masterfrom
bugfix/noid/session-error-handling
Aug 17, 2021
Merged

Only trap E_ERROR in session handling#28464
skjnldsv merged 1 commit into
masterfrom
bugfix/noid/session-error-handling

Conversation

@juliusknorr

Copy link
Copy Markdown
Member

Otherwise PHP errors with any level would cause an ErrorException that would make the code behave as if the operation failed.

E.g. as reported in #28463 where the sesison gc failed which then leads to the session cookie being invalidated in

try {
$this->startSession();
} catch (\Exception$e) {
setcookie($this->invoke('session_name'), '', -1, \OC::$WEBROOT ?: '/');
}
See #28463 (comment) for more details.

Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliusknorrjuliusknorr added bug 3. to review Waiting for reviews labels Aug 17, 2021
@juliusknorrjuliusknorr added this to the Nextcloud 23 milestone Aug 17, 2021
@juliusknorrjuliusknorr mentioned this pull request Aug 17, 2021
@skjnldsv
skjnldsv merged commit 0edfb24 into masterAug 17, 2021
@skjnldsv
skjnldsv deleted the bugfix/noid/session-error-handling branch August 17, 2021 09:39
@juliusknorr

Copy link
Copy Markdown
MemberAuthor

/backport to stable22

@juliusknorr

Copy link
Copy Markdown
MemberAuthor

/backport to stable21

@juliusknorr

Copy link
Copy Markdown
MemberAuthor

/backport to stable20

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@juliusknorr@artonge@skjnldsv