can web session filter be configured to create session on demand

2020-07-22 Thread Cameron Braid
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


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

2020-07-27 Thread Vladimir Pligin
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/