Opened 5 years ago

Closed 5 years ago

#828 closed New feature (fixed)

Piwik should use Zend's session handling

Reported by: fuero Owned by:
Priority: normal Milestone: Piwik 0.4.3
Component: Core Keywords: session handling zend
Cc: Sensitive:

Description

I just tried to use Zend's session namespaces in a plugin, and failed. As it seems, the usage of session_start and of $_SESSION in Piwik prevents plugins from using this.
The attached patch should apply cleanly against 0.4.1, I replaced every occurance of $_SESSION with a new Zend session namespace named after the core component/plugin.
I tested the Installer plugin, should work fine.

Attachments (2)

session-handling.2.patch (12.1 KB) - added by fuero 5 years ago.
session-handling.patch (12.1 KB) - added by fuero 5 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 5 years ago by vipsoft (robocoder)

Yet you skipped core/Config.php and plugins/Dashboard?

comment:2 Changed 5 years ago by fuero

my bad, forgot to add plugins/Dashboard to the patch. The comment in core/Config.php has been updated too.

Changed 5 years ago by fuero

Changed 5 years ago by fuero

comment:3 Changed 5 years ago by vipsoft (robocoder)

  • Type changed from Bug to New feature

comment:4 Changed 5 years ago by vipsoft (robocoder)

Instead of removing session_start(), shouldn't it be replaced with Zend_Session::start()?

comment:5 Changed 5 years ago by fuero

Look at libs/Zend/Session/Namespace.php, line 116 - it's called by the constructor anyway.

comment:6 Changed 5 years ago by vipsoft (robocoder)

Right. And Zend_Session is indirectly used by Zend_Auth...

comment:7 Changed 5 years ago by vipsoft (robocoder)

Ok, committing with some minor changes.

comment:8 Changed 5 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

(In [1276]) Fixes #828 - use Zend_Session / Zend_Session_Namespace

comment:9 Changed 5 years ago by vipsoft (robocoder)

(In [1286]) refs #828 - fix 'Trying to get property of non-object' error

comment:10 Changed 5 years ago by vipsoft (robocoder)

  • Milestone changed from 1 - Piwik 0.4.2 to 1 - Piwik 0.4.3
  • Resolution fixed deleted
  • Status changed from closed to reopened

PHP 5.2.0 bug causes:

Indirect modification of overloaded property Zend_Session_Namespace::$skipThisStep has no effect
in '/home/hostnser/sd/phpmv/plugins/Installation/Controller.php' at the line 212

Reference: http://framework.zend.com/issues/browse/ZF-1743

comment:11 Changed 5 years ago by vipsoft (robocoder)

(In [1339]) fixes #885, refs #828 - dispatcher starts/resumes session unless PIWIK_ENABLE_SESSION_START=0

comment:12 Changed 5 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [1348]) fixes #828 - workaround ZF1743 and refactor session handling code

Note: See TracTickets for help on using tickets.