How is session expiration expected to work considering this?

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

How is session expiration expected to work considering this?

Mariano Martinez Peck
Hi guys,

I was not yet able to correctly set session expiration timeout for my app. I was doing something like this:

------------

app := (WAAdmin register: self asApplicationAt: aSuffix)
preferenceAt: #sessionClass put: DpWebSession;
preferenceAt: #actionPhaseContinuationClass put: FaCallbackProcessingActionContinuation;
preferenceAt: #trackingStrategy put: FaWAQueryFieldAndCookieTrackingStrategy new;
yourself.

app configuration at: #maximumRelativeAge put: seconds.
app configuration at: #maximumAbsoluteAge put: 0.

"much more here to continue  customizing the app" 
....


-----------


What is the problem? That #register:asApplicationAt: ends up creating the cache BEFORE I can change the configuration...   so the 'cache' is created with the default 1800 rather than with what I want. 

The workaround is to either do "app cache: app createCache"   or "app initialize" once I am done with all my configuration... but it looks... weird...

Thoughts? 



--

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How is session expiration expected to work considering this?

Johan Brichau-2
Hi Mariano,

You indeed need to replace the cache when you changed the configuration values.
This is how it’s done in the configuration interface (see implementation of #replaceCache).

I agree it’s not intuitive. 
Perhaps we should expand WAAdmin with specific methods to configure a cache, such that the cache is reset afterwards.

cheers
Johan

On 31 Jul 2017, at 21:49, Mariano Martinez Peck <[hidden email]> wrote:

Hi guys,

I was not yet able to correctly set session expiration timeout for my app. I was doing something like this:

------------

app := (WAAdmin register: self asApplicationAt: aSuffix)
preferenceAt: #sessionClass put: DpWebSession;
preferenceAt: #actionPhaseContinuationClass put: FaCallbackProcessingActionContinuation;
preferenceAt: #trackingStrategy put: FaWAQueryFieldAndCookieTrackingStrategy new;
yourself.

app configuration at: #maximumRelativeAge put: seconds.
app configuration at: #maximumAbsoluteAge put: 0.

"much more here to continue  customizing the app" 
....


-----------


What is the problem? That #register:asApplicationAt: ends up creating the cache BEFORE I can change the configuration...   so the 'cache' is created with the default 1800 rather than with what I want. 

The workaround is to either do "app cache: app createCache"   or "app initialize" once I am done with all my configuration... but it looks... weird...

Thoughts? 



--
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How is session expiration expected to work considering this?

Mariano Martinez Peck


On Tue, Aug 1, 2017 at 3:16 AM, Johan Brichau <[hidden email]> wrote:
Hi Mariano,

You indeed need to replace the cache when you changed the configuration values.
This is how it’s done in the configuration interface (see implementation of #replaceCache).

I agree it’s not intuitive. 
Perhaps we should expand WAAdmin with specific methods to configure a cache, such that the cache is reset afterwards.


Thanks Johan for confirming that what I was finally doing was correct. 

Another alternative to your approach on the issue above, what if we provide a:

register: self asApplicationAt: aSuffix configuration: aConfiguration

So that the things get created from scratch with the correct configuration? 

 
cheers
Johan

On 31 Jul 2017, at 21:49, Mariano Martinez Peck <[hidden email]> wrote:

Hi guys,

I was not yet able to correctly set session expiration timeout for my app. I was doing something like this:

------------

app := (WAAdmin register: self asApplicationAt: aSuffix)
preferenceAt: #sessionClass put: DpWebSession;
preferenceAt: #actionPhaseContinuationClass put: FaCallbackProcessingActionContinuation;
preferenceAt: #trackingStrategy put: FaWAQueryFieldAndCookieTrackingStrategy new;
yourself.

app configuration at: #maximumRelativeAge put: seconds.
app configuration at: #maximumAbsoluteAge put: 0.

"much more here to continue  customizing the app" 
....


-----------


What is the problem? That #register:asApplicationAt: ends up creating the cache BEFORE I can change the configuration...   so the 'cache' is created with the default 1800 rather than with what I want. 

The workaround is to either do "app cache: app createCache"   or "app initialize" once I am done with all my configuration... but it looks... weird...

Thoughts? 



--
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside




--

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside