Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(session): Do not log fresh/empty session as error #41318

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

ChristophWurst
Copy link
Member

@ChristophWurst ChristophWurst commented Nov 7, 2023

This regression was introduced with #40879.

Summary

An empty session can't be decrypted. We can safely ignore this condition and only log if a value is set and that value can't be decrypted.

How to test

  1. Open Nextcloud
  2. Restart the webserver to flush session data
  3. Reload the Nextcloud page

Master: error is logged because the session file is empty.
Here: no error is logged.

Checklist

'exception' => $e,
]);
if ($encryptedSessionData === '') {
// Nothing to decrypt
$this->sessionValues = [];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I'm not entirely sure about is whether we need to regenerate the session ID here. But it seems useless if the session we currently have is empty anyway. Regenerating will more likely cause race conditions.

@solracsf solracsf added this to the Nextcloud 28 milestone Nov 10, 2023
This was referenced Nov 10, 2023
@ChristophWurst ChristophWurst merged commit 78d5ec4 into master Nov 10, 2023
50 checks passed
@ChristophWurst ChristophWurst deleted the fix/session/empty-session-error-logging branch November 10, 2023 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: 28.0.0-beta1 - "Could not decrypt or decode encrypted session data"
4 participants