[Seaside] Seaside 2.9 - how do I access session ivars?
Mariano Martinez Peck
marianopeck at gmail.com
Mon Jul 20 18:08:42 UTC 2009
On Mon, Jul 20, 2009 at 5:01 PM, Paul DeBruicker <pdebruic at gmail.com> wrote:
> Hi -
> I am in the initial stages of porting some code to Seaside2.9a3. The
> code works in Seaside 2.8.4. When a user logs in I store their user
> info in the session in an instance variable called user. In Seaside
> 2.8.4 calling 'self session user userId' would return the user's user
> id, after they'd logged in. With whatever I've done + 2.9a3 calling:
> self session user userId
> inside a renderContentOn: method throws an error that says
> UndefinedObject(Object)>>doesNotUnderstand: #userId. In the debugger
> for that error if I try to explore 'self session' I get a
> WARequestContextNotFound error. I do include
> webapp preferencesAt: #sessionClass add: AMSession.
> in the initialize statement for the application. I'm willing to
> believe that my login function is also a little off because I set the
> session ivar 'user' with 'self session user: user'
> How do I store and access information in the session in Seaside 2.9?
> Is it the same as 2.8.4 and I've just got another error somewhere else
> thats just showing up here? I'd appreciate any suggestions for
> remedying my lack of understanding. Thanks
I never tested 2.9 but reading here:
"#application and #session will raise a WARequestContextNotFound error if no
current request context is found. This should only happen outside of the
scope of a Seaside request. If your objects are using these methods as part
of their display string (they probably shouldn’t) you will want to catch the
error to avoid problems when opening an Inspector on your object."
I don't know if this help.
> seaside mailing list
> seaside at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside