Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HttpSession request.getSession(false)

I have a problem. In my servlet in glassfish I call the method request.getSession(false). It should return null. But instead there is always a session returned. Moreover, if I invalidate the session right before the call to getSession(false) - it returns null. It means something else creates the session! What could that be? The servlet is redirected from the .jsp page. I am using the glassfish.

like image 798
Artem Moskalev Avatar asked Dec 20 '25 06:12

Artem Moskalev


1 Answers

Have you disabled the session in JSP? At the top of your jsp:

<%@ page language="java" session="false"%>
like image 79
tibo Avatar answered Dec 21 '25 19:12

tibo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!