How to access session in simple-method?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to access session in simple-method?

Christian Carlow-OFBizzer
Anyone know how to access the session in simple methods so that
setAttribute and getAttribute can be performed?
Reply | Threaded
Open this post in threaded view
|

Re: How to access session in simple-method?

Adrian Crum-3
 From my perspective, modifying the session object in Mini-language is  
a bad idea. There are plenty of examples of request events and  
services modifying the session object, but doing so always results in  
quirky behavior.

If you need to persist a value, then it would be best to store the  
value in the database.

-Adrian


Quoting Christian Carlow <[hidden email]>:

> Anyone know how to access the session in simple methods so that  
> setAttribute and getAttribute can be performed?
>



Reply | Threaded
Open this post in threaded view
|

Re: How to access session in simple-method?

Christian Carlow-OFBizzer
Thanks Adrian,

So is it best not to use <session-to-field> and <field-to-session>?

On 01/10/2014 01:15 PM, [hidden email] wrote:

> From my perspective, modifying the session object in Mini-language is
> a bad idea. There are plenty of examples of request events and
> services modifying the session object, but doing so always results in
> quirky behavior.
>
> If you need to persist a value, then it would be best to store the
> value in the database.
>
> -Adrian
>
>
> Quoting Christian Carlow <[hidden email]>:
>
>> Anyone know how to access the session in simple methods so that
>> setAttribute and getAttribute can be performed?
>>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: How to access session in simple-method?

Christian Carlow-OFBizzer
Minilang cannot replace some java and groovy files?

On 01/10/2014 01:34 PM, Christian Carlow wrote:

> Thanks Adrian,
>
> So is it best not to use <session-to-field> and <field-to-session>?
>
> On 01/10/2014 01:15 PM, [hidden email] wrote:
>> From my perspective, modifying the session object in Mini-language is
>> a bad idea. There are plenty of examples of request events and
>> services modifying the session object, but doing so always results in
>> quirky behavior.
>>
>> If you need to persist a value, then it would be best to store the
>> value in the database.
>>
>> -Adrian
>>
>>
>> Quoting Christian Carlow <[hidden email]>:
>>
>>> Anyone know how to access the session in simple methods so that
>>> setAttribute and getAttribute can be performed?
>>>
>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: How to access session in simple-method?

Adrian Crum-3
In reply to this post by Christian Carlow-OFBizzer
In my opinion, yes. Others will disagree.

In my experience, storing things in the session causes really strange  
behavior in tabbed browsers - because all tabs share a single session.  
Also, the data vanishes when the session expires - which causes a  
bizarre user experience ("Where did my shopping cart go??").

-Adrian


Quoting Christian Carlow <[hidden email]>:

> Thanks Adrian,
>
> So is it best not to use <session-to-field> and <field-to-session>?
>
> On 01/10/2014 01:15 PM, [hidden email] wrote:
>> From my perspective, modifying the session object in Mini-language  
>> is a bad idea. There are plenty of examples of request events and  
>> services modifying the session object, but doing so always results  
>> in quirky behavior.
>>
>> If you need to persist a value, then it would be best to store the  
>> value in the database.
>>
>> -Adrian
>>
>>
>> Quoting Christian Carlow <[hidden email]>:
>>
>>> Anyone know how to access the session in simple methods so that  
>>> setAttribute and getAttribute can be performed?
>>>
>>
>>
>>
>
>