I have a jetty container with two different servlets, lets call then A and B.
In a special occasion a qr code code appear in servlet A (the user is already logged in and is using his desktop) and the user by using his mobile device read this qr code and is redirected the servlet B on his mobile device. The problem here is that i cant keep his session.
The QR code brings the user session key however i have no way to verify if this session is valid. I would like to know if there is any special method to request the valid session keys on jetty, since both servlet are in the same server.
Well the best solution i found was to establish a HttpSessionListener 🙂
for that we have to override some methods:
}
and then set the listener on /WEB-INF/web.xml
Now we can call at anywhere inside the package the HttpSessionCollector.
e.g. to obtain all valid sessions we have just to: