Kizspy Question: 28
(Choose 1 answer)
You are developing a JSP application that requires user authentication. Explain how you would use session
management to track the user's login status and securely store user information.
<%@ page import="javax.servlet.http.HttpSession" %>
<%
HttpSession session = request.getSession(); session.setAttribute("loggedInUser", "username");
%>
A. Describe the purpose of the provided code and how the session is utilized for user authentication.
B. Propose enhancements to ensure secure session management and prevent session hijacking.
C. Explain how the code handles session timeouts.
D. Discuss the role of cookies in session management.