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 invalid session start #21468

Closed
wants to merge 1 commit into from
Closed

Conversation

HolgerHees
Copy link
Contributor

@HolgerHees HolgerHees commented Jun 18, 2020

This will fix errors like A session had already been started

The reason was that there was a already started session and regenerateId() was assigning a new session id to it. So there is no need to call start_session() again.

This will fix #20490

This will fix errors like "A session had already been started"

The reason was that there was a already started session and ->regenerateId() was assigning a new session id to it. So there is no need to call start_session() again.

This will fix nextcloud#20490
@solracsf solracsf requested a review from rullzer June 18, 2020 13:15
@solracsf solracsf added 3. to review Waiting for reviews bug labels Jun 18, 2020
Copy link
Member

@korelstar korelstar left a comment

Choose a reason for hiding this comment

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

This fixes the issue for me. Please backport!

@kesselb
Copy link
Contributor

kesselb commented Jun 20, 2020

Thank you for sending a patch 👍

Today I run into the change accidentally that is causing that issue: https://github.com/nextcloud/server/pull/17075/files#diff-c68da9343553e4a58b89b1e38a975a70

It seems this issue is present for quite a while but in older versions a new session is started like $this->invoke('session_start', [], true); and true as third parameter silences every error ;)

As the session is only unset and not destroyed it seems reasonable to me that startSession throws an error and I wonder if that is intended. How do we send the new session id to the user after regenerate?

@HolgerHees
Copy link
Contributor Author

HolgerHees commented Jun 20, 2020

@kesselb can you append your comment to my pull request. just that the other devs are aware of your concerns.

my guess is that regenerate_session id is send the session id to the user, because it is a php core function which will handle this automatically.

@kesselb
Copy link
Contributor

kesselb commented Jun 20, 2020

@HolgerHees usually @rullzer read's the comments on a pull request ;)

@MorrisJobke
Copy link
Member

This was fixed a little bit different in #22243

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 bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error in nextcloud.log after logout
5 participants