-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom ("user") session handler using database (ie MySQL) instead of "files" #1279
Comments
(In [2121]) refs #1279 - refactor session initialization code out of index.php |
(In [2122]) refs #1279 - fallback to system default |
(In [2280]) refs #1279 - test that session.save_path is also readable, otherwise Zend_Session_Exception: Zend_Session::start() - /PATH/libs/Zend/Session.php(Line:480): Error #8 session_start(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied |
I've confirmed on my fresh install that this patch fixes the exception output. Thank you. |
Reprioritizing. On the demo server, I noticed we have 285000+ session files in piwik/tmp/sessions -- most being empty files. That's a lot of inodes, and could be a problem for some users with shared hosting accounts. |
Nice to have:
|
Other suggestions:
|
Using a DB table should avoid the potential race condition experienced with locked session files (see #2296). |
(In [4761]) refs #1279 - add session table |
(In [4762]) refs #1279 - add update script and bump version |
(In [4763]) refs #1279 - fix typo |
(In [4764]) refs #1279 - typo |
(In [4765]) fixes #1279 |
CI shows the update fails:
|
Interesting!!
This is great feature because it will ensure that load balanced Piwik Reporting UI will work fine without requiring to "stick" same users to the same backend server! |
(In [4766]) Refs #1279 Important to copy paste the table definitions in update files: this ensures that subsequent "ALTER" on these tables will work fine (otherwise, if we change table definition in myisam file in 1.8, and users upgrade from 1.4 to 1.9, the 1.5 upgrade will install the newest version of 1.8 tables which will then fail the 1.8 ALTER table on this table..) |
I had to move the Piwik_Session::start() to front controller because the save handler needs the $db handle. Purge: the frequency of cleanup and lifetime is defined in php.ini (e.g., session.gc_maxlifetime) re: r4767 Good point. I'll go back and fix those cases in 0.2.10, 0.2.13, and 0.2.27, so we don't set a bad example. ;) I'm just installing 1.0 now, and going through the auto-update to find out what's causing the problem in comment:30. |
(In [4768]) refs #1279 |
on the update screen I see an error at the bottom, not important but if easy to hide would be nice :) (see attached file) |
Attachment: |
(In [4772]) refs #1279 |
Yes, I saw the exception too. This is fixed in r4772. I'm just waiting for confirmation from Jenkins before I close this ticket. |
Thank you, Jenkins. |
Use Zend_Session_SaveHandler_DbTable.
see: http://zendframework.com/manual/1.10/en/zend.session.savehandler.dbtable.html
For Installation, we would store session information in a signed cookie, and delete the cookie when the installation is complete.
Pros:
Cons:
would have to rework LanguagesManager/API.php's use of Zend_Session_Namespace in getLanguageForSession() and setLanguageForSession()Note: Piwik still requires write access to ./tmp (i.e., templates_c, cache/tracker, latest).
While you're at it, add a systemCheck for the 'session' extension, in case php was compiled with --disable-session.And look into handling disabled ini_set() -- used by Zend_Session.
Oh, and make sure we handle the case where session.use_cookies = 0 (ref: http://forum.piwik.org/index.php?showtopic=11381)
The text was updated successfully, but these errors were encountered: