Skip to content

Set session object's _state to 'inactive' when session is closed#12928

Merged
wilsonge merged 1 commit intojoomla:stagingfrom
chrBrd:sessionPatch
Nov 18, 2016
Merged

Set session object's _state to 'inactive' when session is closed#12928
wilsonge merged 1 commit intojoomla:stagingfrom
chrBrd:sessionPatch

Conversation

@chrBrd
Copy link
Copy Markdown
Contributor

@chrBrd chrBrd commented Nov 17, 2016

Currently, if a session is closed (not destroyed) the session object's _state property remains set as 'active'. Consequently, using the session object's start() method will result in it returning before it can do anything.

As a session has been ended by the server once the close() method has been called the object's _state property should possibly be set to 'inactive'.

Summary of Changes

Amended JSession class' close() method to set session object's _state property to 'inactive' after a session is ended by the server.

Testing Instructions

  • Apply patch.
  • Wait for a session to start.
  • Close it using close();
  • The session object's _state property will be set to 'inactive' once the handler's save() method has been executed and the server has ended the session.

Documentation Changes Required

None

Note

In my testing before implementing this I couldn't see any good reason for a session object's state to remain 'active' once the actual session's been ended by the server; I accept there may well be one I overlooked.

@wilsonge
Copy link
Copy Markdown
Contributor

This is the kinda change which is going to cause all kinds of people all kinds of issues I'm sure. But it looks clearly correct to me so I'm going to bite the bullet and merge on review

@wilsonge wilsonge merged commit 117a9a1 into joomla:staging Nov 18, 2016
@wilsonge wilsonge added this to the Joomla 3.7.0 milestone Nov 18, 2016
roland-d added a commit to roland-d/joomla-cms that referenced this pull request Nov 25, 2016
* staging: (98 commits)
  Coding style. PHP constants true, false, and null MUST be in lower case. (joomla#13010)
  Removing duplicated AS in sql query (joomla#13006)
  Fixed typo in comment (joomla#12992)
  Correcting strings in TFA Google plugin (joomla#12980)
  code style changes (joomla#12986)
  Error in sr-YU installation ini file (joomla#12984)
  New DateTime picker (replaces calendar) (joomla#11138)
  Export of Banners Tracks Does Not Export the Banner Name
  fix rues get data (joomla#12763)
  Added Feature items filter to mod_articles_news (joomla#12547)
  fix them all (joomla#12943)
  a11y regression fix (joomla#12935)
  Set correct component id for system links (joomla#12938)
  Fix for Undefined offset in Content History preview popup (joomla#12791)
  remove tab on meta charset (joomla#12895)
  JSession patched to set session _state to 'inactive' when session is closed. (joomla#12928)
  [JHtmlNumber::bytes] Format number according to language (joomla#12929)
  Update edit.php (joomla#12818)
  Update default.xml (joomla#12917)
  Adding the ability to use the global value for character count in newsfeeds (joomla#12869)
  ...
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.

3 participants