In Jsp,creating sessions is an important task for any webpages.
By using sessions you will maintain the users status until he logged out.
First lets creating a session for a name.create a html page
index.html
Quote:<html>
<body>
<form action="set.jsp" method="get">
<input type="text" name="name">
<input type="submit" value="submit"/>
</form>
</body>
</html>
set.jsp
<%
String name=request.getParameter("name");
session.setAttribute("name",name);
response.sendRedirect("get.jsp");
%>
get.jsp
Welcome
<%=session.getAttribute("name") %>
Now you are creating session successfully lets try this in more no of page you can.
For invalidating the session use
session.invalidate();
Any doubt do ask us bye bye