Application State in long lived cookies

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Application State in long lived cookies

richard.hensley
I'm wanting to create an application object that survives visits to the
site, but I don't want to store the preferences in server state because It's
just not that important. I think I want an Application State object that is
stored in a cookie.

In order to accomplish this, I think I need to do the following:

Create an implementation of the StateObjectPersistenceManager that manages
state by squeezing and unsqueezing the value into cookies that are names
after the application and object name. Something very similar to the
SessionScopeManager.

Create an extension of the CookieSourceImpl class that has more properties
so life time of the Cookie. The current implementation creates transient
cookies for the default context path of the application.

Configure up my CookieSourceImpl extension in hivemind.

Configure up my CookieScopeManager to use my new CookieSourceImpl in
hivemind.xml

Contribute my CookeScopeManager to the
tapestry.state.StateObjectpersistenceManagers" configuration point under the
name permcookie

  <contribution configuration-id="StateObjectPersistenceManagers">
    <manager scope="cookie" object="service:CookieScopeManager"/>

Did I missing anything?

I'm starting now, and I will let you know how it goes.

Richard


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]