import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class PreSession extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse res)
			throws IOException, ServletException {
		res.setContentType("text/html");
		PrintWriter pw = res.getWriter();
		HttpSession ssn = req.getSession(false);
		pw.println("Checking the Session existance<br>");
		if (ssn == null) {
			pw.println("Session is not available <br> Creating a new session.........");
		} else
			
			pw.println("Your session is already created");
		}
	
}