Summary | New Horde_Session class |
Queue | Horde Framework Packages |
Queue Version | Git master |
Type | Enhancement |
State | Resolved |
Priority | 3. High |
Owners | Horde Developers (at) , slusarz (at) horde (dot) org |
Requester | slusarz (at) horde (dot) org |
Created | 02/23/2009 (5953 days ago) |
Due | |
Updated | 11/21/2010 (5317 days ago) |
Assigned | |
Resolved | 11/21/2010 (5317 days ago) |
Milestone | 4 |
Patch | No |
State ⇒ Resolved
Allow ability to search session subkeys.
We store values with key & subkey together to save on storage/serialization
costs. To retrieve array like output, simply need to call
$session['app:name/'] - returns an array with subkeys as keys and session
values as values.
Ticket #8023http://git.horde.org/diff.php/framework/Core/lib/Horde/Session.php?rt=horde-git&r1=ddc248a3b4a3a362c76761312ec0b634528b3430&r2=4d2812f01520cc485dcac545c5f738b7d7b54025
Remove horde/SessionObjects and replace with Horde_Session use
NOTE: Did not change Kolab_Session usage because I have little/no idea
what is going on in there (injecting may be good for some things, but
things, but it does make it MUCH more difficult to try and track the code.
Granted, some of this may be simply that I am not familiar with the
Kolab code, however...)
Ticket #8023delete mode 100644 framework/SessionObjects/lib/Horde/SessionObjects.php
delete mode 100644 framework/SessionObjects/package.xml
http://git.horde.org/diff.php/framework/Core/lib/Horde/Core/Factory/Group.php?rt=horde-git&r1=c51bb9d8a341b5c12416201f6ae21168732274cd&r2=ddc248a3b4a3a362c76761312ec0b634528b3430
http://git.horde.org/diff.php/framework/Core/lib/Horde/Core/Factory/Share.php?rt=horde-git&r1=c685edee620ef4d9931ef899c7f1ad162bf430af&r2=ddc248a3b4a3a362c76761312ec0b634528b3430
http://git.horde.org/diff.php/framework/Core/lib/Horde/Session.php?rt=horde-git&r1=b2b8560ee168359cce8eb42f82ea1358340fa9af&r2=ddc248a3b4a3a362c76761312ec0b634528b3430
http://git.horde.org/diff.php/framework/Group/lib/Horde/Group.php?rt=horde-git&r1=57a6d43c74123be9e8212734e9931032d97d8b2b&r2=ddc248a3b4a3a362c76761312ec0b634528b3430
http://git.horde.org/diff.php/framework/Kolab_Session/package.xml?rt=horde-git&r1=fc2d8ef0b26a4eef81bee2bbb406fd179496fc54&r2=ddc248a3b4a3a362c76761312ec0b634528b3430
http://git.horde.org/diff.php/framework/Kolab_Storage/package.xml?rt=horde-git&r1=26ba03c9bb092b872fdbd96a787ee7e10e63ea2f&r2=ddc248a3b4a3a362c76761312ec0b634528b3430
http://git.horde.org/diff.php/framework/SessionObjects/lib/Horde/SessionObjects.php?rt=horde-git&r1=326e7ce0d176377f1a94f4db11d7e3a6139109af&r2=ddc248a3b4a3a362c76761312ec0b634528b3430
http://git.horde.org/diff.php/framework/SessionObjects/package.xml?rt=horde-git&r1=326e7ce0d176377f1a94f4db11d7e3a6139109af&r2=ddc248a3b4a3a362c76761312ec0b634528b3430
http://git.horde.org/diff.php/imp/lib/Crypt/Pgp.php?rt=horde-git&r1=00c63fa70475450522f1f98b802f50a7c6cbb5bd&r2=ddc248a3b4a3a362c76761312ec0b634528b3430
http://git.horde.org/diff.php/imp/lib/Crypt/Smime.php?rt=horde-git&r1=ac924f3cbf088390bf3dcef34f95c051b2a92c7b&r2=ddc248a3b4a3a362c76761312ec0b634528b3430
http://git.horde.org/diff.php/imp/lib/Injector/Factory/Compose.php?rt=horde-git&r1=00c63fa70475450522f1f98b802f50a7c6cbb5bd&r2=ddc248a3b4a3a362c76761312ec0b634528b3430
http://git.horde.org/diff.php/imp/lib/Prefs/Ui.php?rt=horde-git&r1=00c63fa70475450522f1f98b802f50a7c6cbb5bd&r2=ddc248a3b4a3a362c76761312ec0b634528b3430
http://git.horde.org/diff.php/ingo/lib/Storage.php?rt=horde-git&r1=326e7ce0d176377f1a94f4db11d7e3a6139109af&r2=ddc248a3b4a3a362c76761312ec0b634528b3430
Ticket #8023: Add transparent lzf compression to Horde_Session.Only compress arrays and objects at this time.
http://git.horde.org/diff.php/framework/Core/lib/Horde/Session.php?rt=horde-git&r1=a9754245850ddedcf552aaf73195748e24d5c79b&r2=bf4c43fcee6137a1418658c79e0f6e15496d97f0
http://git.horde.org/diff.php/framework/Core/package.xml?rt=horde-git&r1=6a64863d678589d3ecbce8a97c075d2bcd84d7ae&r2=bf4c43fcee6137a1418658c79e0f6e15496d97f0
Ticket #8023: Add ArrayAccess implementation to Horde_Session.This is the new API for accessing session variables. What previously
looked like:
$_SESSION['app']['foo']
Now looks like:
$GLOBALS['session']['app:foo']
http://git.horde.org/diff.php/framework/Core/lib/Horde/Session.php?rt=horde-git&r1=d2b3eb6a89d574aac60dc5150b159d1a5aadd6bc&r2=a9754245850ddedcf552aaf73195748e24d5c79b
New Attachment: locking-session-code.zip
implemented here - definitely not per-variable. I'm attaching some
code that I think was from the original article I referenced. Another
way to go here would be some sort of HTML 5 storage, or an abstraction
around that, to keep the data on the client.
Bug #8023: Initial creation of Horde_Session.Does nothing more than move code out of Horde_Registry.
create mode 100644 framework/Core/lib/Horde/Session.php
http://git.horde.org/diff.php/framework/Core/lib/Horde/Registry.php?rt=horde-git&r1=d6b83bfb3fd0988403c6b074a855d5c2f1342e11&r2=d2b3eb6a89d574aac60dc5150b159d1a5aadd6bc
http://git.horde.org/co.php/framework/Core/lib/Horde/Session.php?rt=horde-git&r=d2b3eb6a89d574aac60dc5150b159d1a5aadd6bc
http://git.horde.org/diff.php/framework/Core/package.xml?rt=horde-git&r1=d6b83bfb3fd0988403c6b074a855d5c2f1342e11&r2=d2b3eb6a89d574aac60dc5150b159d1a5aadd6bc
http://git.horde.org/diff.php/horde/admin/sessions.php?rt=horde-git&r1=6fb6926b2a115f3410d0a924bc6e8eb008ee3cf9&r2=d2b3eb6a89d574aac60dc5150b159d1a5aadd6bc
http://git.horde.org/diff.php/horde/bin/active_sessions?rt=horde-git&r1=406a76b3bc7dfacfaefd44dec845a6d050f7dce5&r2=d2b3eb6a89d574aac60dc5150b159d1a5aadd6bc
http://git.horde.org/diff.php/horde/login.php?rt=horde-git&r1=5119c0b8e88220c9a0ac1bbdf2c75c55cd608653&r2=d2b3eb6a89d574aac60dc5150b159d1a5aadd6bc
Priority ⇒ 3. High
Milestone ⇒ 4
functionality here. Provides quick/easy way for apps to store data
that needs to persist over a page load but can eventually be garbage
collected.
has changed without needing to do serialize->md5 twice a page load on
the session data.
performance here. If you have another way in mind to not lock out a
user while a long-running page is processing, that's fine, but I want
Horde 4 to have some easy way to take care of that problem.
being filtered or emptied, for example. Or when the current sidebar
ajax reloads while another page is loading. And I expect all of this
to get more common with rich apps where ajax requests can fire from
different parts of the page.
can live with performance issues if using multiple different tabs.
The article linked to in this article mostly seems concerned with race
conditions. Since we do locking in our sessionhandlers, it does not
pertain to us.
session, I think it's a good idea to be able to separate them. If we
use the session_write_close/session_open trick and stop storing
things like MIME objects in the session, then I can let it go.
rewrite). In fact, the major culprit size-wise is registry data
(almost 35% of the session size) and cached prefs data. I've been
thinking about ways to remove the registry data for months now, since
95% of the data in there is never used by the application in any given
session. In terms of improving session size, this is the place to
attack. I'll file another ticket for this issue.
being filtered or emptied, for example. Or when the current sidebar
ajax reloads while another page is loading. And I expect all of this
to get more common with rich apps where ajax requests can fire from
different parts of the page.
As long as we have longer-running requests and/or large items in the
session, I think it's a good idea to be able to separate them. If we
use the session_write_close/session_open trick and stop storing things
like MIME objects in the session, then I can let it go.
locking. That's a boatload of overhead for a dubious gain. I can't
think of a place in Horde where we run into race conditions right now.
State ⇒ Assigned
Patch ⇒ No
Milestone ⇒
Assigned to
Assigned to Michael Slusarz
Queue ⇒ Horde Framework Packages
Summary ⇒ New Horde_Session class
Type ⇒ Enhancement
Priority ⇒ 1. Low
Quoting Michael M Slusarz <slusarz@horde.org>:
that wouldn't grow beyond a certain point, so it shouldn't be the
answer here either, really. :)
interact with all session data. Would allow us to do stuff like
transparent compression of larger pieces of session data.
abstraction layer over sessions. The other reason is to separate data
into different buckets, so that we don't have a single, locking blob
of data. I've been interested in doing this for a while, inspired by
this article:
http://thwartedefforts.org/2006/11/11/race-conditions-with-ajax-and-php-sessions/
What do you think of replacing sessionobjects with something more like that?
-chuck