Skip to content

Conversation

ZhandosKz
Copy link
Contributor

Hello!
When two scripts simultaneously turning to session data, session id regeneration sometimes fails by "session_regenerate_id (): Session object destruction failed". This is a race condition. Maybe a recording session should be closed before regeneration?

@samdark
Copy link
Member

samdark commented Jan 7, 2014

Have you tested your changes?

@ZhandosKz
Copy link
Contributor Author

So I test it with running one more scripts by ajax, after this changes session regenated succesfully,
Need more unit tests?

@samdark
Copy link
Member

samdark commented Jan 7, 2014

Are you able to write to session after calling regenerateID?

@ZhandosKz
Copy link
Contributor Author

You're right, there was an error with the subsequent entry in the session, resolved by re-calling session_start.
The answer to this question I found here http://toster.ru/q/4962 (rus)
Have a some ideas to solve the problem?

@samdark
Copy link
Member

samdark commented Jan 7, 2014

@samdark
Copy link
Member

samdark commented Jan 7, 2014

yiisoft/yii#2376

@samdark
Copy link
Member

samdark commented Jan 7, 2014

@qiangxue qiangxue closed this in 646e371 Feb 4, 2014
@qiangxue
Copy link
Member

qiangxue commented Feb 4, 2014

I "fixed" it by hiding the warning message. Because this issue is caused by race condition, I don't see a perfect solution to it. Could you test it to see if it works for you now?

tonydspaniard added a commit to tonydspaniard/yii2 that referenced this pull request Feb 5, 2014
* upstream: (106 commits)
  fixed i18n link
  one more revert.
  Reverted changes unrelated to issue yiisoft#2325
  Revert "fixing wrapping - my NetBeans has a mind of its own."
  Revert "deleting one space before `:`"
  deleting one space before `:`
  fixing wrapping - my NetBeans has a mind of its own.
  Adding support for the X-HTTP-Method-Override header.
  fixed test break.
  adjusted required packages for yii2-dev.
  Fixes yiisoft#1812: Hide potential warning message due to race condition occurring to `Session::regenerateID()` call
  docs fix
  fixed docs, added checks
  Fixed globalOptions array issue.
  removed suffix, since it will be applied later in getFixturesConfig method.
  method names fixed
  added docs
  added suffix
  added globalFixtures option
  Removed duplicated getAlias call.
  ...
@cebe cebe added this to the 2.0 Beta milestone Feb 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants