Message Boards

How to add custom HttpSessionListener

Dinh Tran, modified 4 Years ago.

How to add custom HttpSessionListener

New Member Post: 1 Join Date: 12/25/20 Recent Posts

Hi all, how can I add a custom HttpSessionListener to Liferay or serlet container. Where should i place the listener class. I'm using LR 7.0.4 GA5, OSGI module portlet. Thanks

thumbnail
Olaf Kock, modified 4 Years ago.

RE: How to add custom HttpSessionListener

Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts

First, you should upgrade and patch. Urgently and Importantly!

Then, the question is what you're going to do with this Listener. Most likely there's an even better place to add your implementation, e.g. a Lifecycle Action - e.g. one that's executed on every login event, or others. Which one it is requires more knowledge about what you're doing. I'd say that most likely a HttpSessionListener is often too low-level for the general abstraction that you get with Liferay.