Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Vijay Kumar
Session
1 Answer(s)      4 years and a month ago
Posted in : Servlet Interview Questions


How fined session is new or old ?


Advertisement
View Answers

November 17, 2010 at 3:25 PM


import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class CheckSession extends HttpServlet{
  protected void doGet(HttpServletRequest request, HttpServletResponse response)
                                   throws ServletException, IOException {
    response.setContentType("text/html");
    PrintWriter pw = response.getWriter();
    pw.println("Check the session is new or old<br>");
    HttpSession session = request.getSession();
    if(session.isNew()){
      pw.println("You have created a new session");
    }
    else{
      pw.println("Session already exists");
    }
  }
}


Related Tutorials/Questions & Answers:
session
session  is there any possibility to call one session from another session
session
session  is there any possibility to call one session from another session
Advertisements
Session
Session   how to session maintaining in servlet with use of hidden fieds
session
session  Session management in Java
Session
Session  How fined session is new or old
session
Session Management in PHP  Handling session in PHP. Can anyone please explain it with the help of an existing example about, how to handle a session while a user is logged in PHP
Session
Session   How can we set the inactivity period on a per-session basis?   We can set the session time out programmatically by using the method setMaxInactiveInterval() of HttpSession
session
session   explain sessioln tracking in jsp and display program
session
session  Which methods can be invoked by the container on a stateless session bean
session
session  What mechanisms are used by a Servlet Container to maintain session information?   Servlet Container uses Cookies, URL rewriting, and HTTPS protocol information to maintain the session
Session
Session   hii, What Is a Session?   hello, Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor
Session
;A servlet session is created and stored on the server side. The servlet container keeps.... To the maintain the session, Web clients must pass back a valid session.... In this sense, the session is also stored by the client, but only as a token reference
session
session  create multiple login on one page in php but how to use session
session
session  how can transfer data of one page to another page using session in java swing
Session
Session  What Is a Session?   Hi friends, A session... subsequent HTTP requests. There is only one session object available to your PHP scripts at any time. Data saved to the session by a script can be retrieved
Session
Session   why do we need session? actually what stored in a session... and user would not able to retrieve the information. So, Session provides that facility to store information on server memory. 2)Variables are stored in session
session
session  how to implement login-logout session????   Please visit the following links: http://www.roseindia.net/quickguide/tomcat/Logout.shtml http://www.roseindia.net/jsp/javascriptpagerefresh.shtml http
session hanling
session hanling  session handling in facelets/jsf
Session in Php
Session in Php   What Is a Session
session Maintainess
session Maintainess  how to maintain session in struts 2
Session management
Session management  How To Maintain Session in jsp for Online exam project
session handling
session handling  how we can handle session in core java
php session
php session  what is session
Terminate the session
Terminate the session  How to terminate the session
Session control
Session control  Could we make session control in JSP language without having any help of other framework
session invalidate.
session invalidate.  how to invalidate session? i am calling session.invalidate()but not working
session tracking
session tracking  What are the common mechanisms used for session tracking?    Cookies SSL sessions URL- rewriting
session tracking
session tracking  session tracking is of four type. 1.hidden form field 2.url rewriting 3.http session interface 4.cookies. please explan the third type with example
Session Mamangemnt
Session Mamangemnt  Hi all.. I want invalidate the the session for an element in an array .. for EX: a[0] has to invalidate rest a[1],a[2]... has to be in session .. please help me out urgent
Session Mamangemnt
Session Mamangemnt  Hi all.. I want invalidate the the session for an element in an array .. for EX: a[0] has to invalidate rest a[1],a[2]... has to be in session .. please help me out urgent
Session Object
Session Object   What is the Max amount of information that can be saved in a Session Object ?   There is no such limit on the amount of information that can be saved in a Session Object. The only limit is the Session
 

 

 

DMCA.com