Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Piwik should use Zend's session handling #828

Closed
anonymous-piwik-user opened this Issue · 13 comments

2 participants

Anonymous Piwik user Anthon Pang
Anonymous Piwik user

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.
Keywords: session handling zend

Anthon Pang
Collaborator

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

Anonymous Piwik user

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

Anthon Pang
Collaborator

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

Anonymous Piwik user

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

Anthon Pang
Collaborator

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

Anthon Pang
Collaborator

Ok, committing with some minor changes.

Anthon Pang
Collaborator

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

Anthon Pang
Collaborator

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

Anthon Pang
Collaborator

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

Anthon Pang
Collaborator

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

Anthon Pang
Collaborator

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

Anonymous Piwik user anonymous-piwik-user added this to the Piwik 0.4.3 milestone
This was referenced
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.