Can I create a session with GenericServlet?
There are no protocol-specific features in GenericServlet, which is an implementation of the basic, general purpose Servlet interface. Servlet-based sessions are designed only for interactions using the HTTP protocol, which has two key features necessary for a servlet container to simulate continuous user sessions: cookies and URL-based navigation, which supports URL-rewriting. The servlet API therefore places the HttpSession interface in the javax.servlet.http package, and session references are only available through classes in this package.