When working with JavaScript in JSP, I encountered an issue where the userId in session always contains a session ID, even after the session has expired. However, when checking in a Java Action class, the userId is null after the session expires, unlike in JSP. Link to code