<% PageContext pageContext = request.getAttribute("pageContext"); HttpSession session = pageContext.getSession(); %>In the above example, we are getting the current PageContext object from the request attribute and then using it to get the current HttpSession object for the current user's session. Package library is javax.servlet.jsp.