can web session filter be configured to create session on demand

classic Classic list List threaded Threaded
2 messages Options
Cameron Braid Cameron Braid
Reply | Threaded
Open this post in threaded view
|

can web session filter be configured to create session on demand

At the moment the web session filter creates a new session for any request that is mapped to the filter.  

Is it possible to make it create sessions only when request.getSession(true) is called ?

This is needed to support using a http caching proxy server.   

I have pages like / and /about which dont need a session, and I have areas that always need a session like /user and /admin. 

Mapping the filter to /user and /admin is almost a solution, however there are also some other dynamic urls that need access to the session under certain cases based on request parameters.

So ideally the filter would be mapped to / with a 'create on demand' configuration.

Cameron
Vladimir Pligin Vladimir Pligin
Reply | Threaded
Open this post in threaded view
|

Re: can web session filter be configured to create session on demand

Hi Cameron,

I suppose the correct way of achieving the desired behavior is to modify
WebSessionFilter from the Ignite.
For example it's possible to introduce a new context param with a list of
urls that shouldn't be affected by the filter.
And pass a request to a chain in the doFilter method if the request matches.
I suppose you can look here
(https://github.com/apache/ignite/blob/master/modules/web/src/main/java/org/apache/ignite/cache/websession/WebSessionFilter.java#L369).



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/