6.0.0-beta1
7/20/25

[#11573] Horde-active-sessions does not work
Summary Horde-active-sessions does not work
Queue Horde Base
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester tsipizic (at) ccf (dot) auth (dot) gr
Created 10/25/2012 (4651 days ago)
Due
Updated 06/21/2013 (4412 days ago)
Assigned 10/25/2012 (4651 days ago)
Resolved 06/21/2013 (4412 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
06/21/2013 06:03:21 PM Michael Slusarz Assigned to Michael Slusarz
State ⇒ Resolved
 
06/21/2013 06:02:44 PM Git Commit Comment #9 Reply to this comment
Changes have been made in Git (master):

commit b757bc902f25e1338c6355eeda096548f1b1b03c
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Fri Jun 21 11:35:55 2013 -0600

     Restore old session data if we had to create a new session

     Bug #11573

  .../Core/lib/Horde/Core/Factory/SessionHandler.php |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

http://git.horde.org/horde-git/-/commit/b757bc902f25e1338c6355eeda096548f1b1b03c
06/21/2013 12:56:42 AM manuel (at) mausz (dot) at Comment #8 Reply to this comment
Hi Michael,

your fix is not complete. You've to restore the reference stored in 
Session::_data after destroying the session.

This should do the trick:
  if ($new_sess) {
    session_destroy();
+  $GLOBALS['session']->session_data = $old_sess;
  }
04/23/2013 10:01:51 PM Git Commit Comment #7 Reply to this comment
Changes have been made in Git (master):

commit 62843c0e3d9aabf827c7b16355ec3f05bc19a8fa
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Tue Apr 23 15:56:42 2013 -0600

     Fix session data access when calling from command line (Bug #11573)

  .../Core/lib/Horde/Core/Factory/SessionHandler.php |    5 +++--
  framework/Core/lib/Horde/Session.php               |   13 +++++++++++++
  2 files changed, 16 insertions(+), 2 deletions(-)

http://git.horde.org/horde-git/-/commit/62843c0e3d9aabf827c7b16355ec3f05bc19a8fa
04/23/2013 02:19:15 PM manuel (at) mausz (dot) at Comment #6 Reply to this comment
A fix is to use
$GLOBALS['session']->start();
instead of
session_start();
in Horde/Core/Factory/SessionHandler.php

And someone please reopen this ticket.
04/23/2013 01:35:49 PM manuel (at) mausz (dot) at Comment #5 Reply to this comment
I hope my comment will reopen the issue.

I've tried to debug this and I think this never worked (at least with 
PHP 5.4):
* cli access creates the horde session with setup(start=false, ...). 
Thus session_start() will never be called, so there's no session and 
the $GLOBALS['session']->_data property is just a reference to a 
"normal" array.
* as there's no valid session, Horde/Core/Factory/SessionHandler.php 
will call session_start() (in the stub branch) which in turn will 
convert the reference into a normal array (I've no idea what php is 
doing here in it's internals). But I guess this is the reason for the 
additional assignment of $this->_data = &$_SESSION after calling 
session_start() in Horde_Session::_start(...).
* since the connection between $_SESSION and 
$GLOBALS['session']->_data is lost, all calls of 
$GLOBALS['session']->get(...) will be non sense and the function will 
return false
* this is working in hordes frontend because the other branch will be 
used ($new_sess = false)

11/26/2012 11:01:49 AM Jan Schneider State ⇒ No Feedback
 
10/29/2012 10:18:35 PM Michael Slusarz Comment #4 Reply to this comment
You will need to debug then.  I can't reproduce.
10/29/2012 06:44:20 AM tsipizic (at) ccf (dot) auth (dot) gr Comment #3 Reply to this comment
session.auto_start is disabled. I checked before filling the bug 
report. Thanks
Works perfectly fine here.  Sounds like you have session.auto_start 
on in PHP, which the installation documentation explicitly tells you 
to disable.
10/25/2012 11:29:48 PM Michael Slusarz Comment #2
State ⇒ Feedback
Priority ⇒ 1. Low
Reply to this comment
Works perfectly fine here.  Sounds like you have session.auto_start on 
in PHP, which the installation documentation explicitly tells you to 
disable.
10/25/2012 08:09:28 AM tsipizic (at) ccf (dot) auth (dot) gr Comment #1
Patch ⇒ No
State ⇒ Unconfirmed
Milestone ⇒
Queue ⇒ Horde Base
Summary ⇒ Horde-active-sessions does not work
Type ⇒ Bug
Priority ⇒ 2. Medium
Reply to this comment
I am using memcache as session handler and In admin interface I can 
see the Current sessions in admin/sessions.php . Although when trying 
to use the horde-active-sessions script from cli it produces the 
following error.
HORDE: [horde] PHP ERROR: ini_set(): A session is active. You cannot 
change the session module's ini settings at this time [pid 8335 on 
line 97 of "/usr/share/php/Horde/SessionHandler.php"]

Saved Queries