1 of 7

Advanced java programming

Session Tracking

Smt M.Jeevana sujitha

Assistant Professor

Department of Computer Science and Engineering

SRKR Engineering College, Bhimavaram, A.P. - 534204

2 of 7

OBJECTIVES

The Objective of this lecture is

  • To learn about session tracking mechanism in servlets.

3 of 7

Session Tracking

are two types of

  • Basically there protocols.
  • Stateful protocol
  • Stateless protocol

4 of 7

Session Tracking

  • Stateful protocol: In this protocol, part of data is exchanged between client and server and these

protocols always keep tack of communication sessions.

Example: TCP

  • Stateless protocol: In this protocol, part of data is

exchanged between client and server and these protocols can not remember previously held communications.

Example: HTTP

  • But some times there is a need to keep track of previous communication sessions. In such situations we go for session tracking.

5 of 7

Session Tracking

  • The session tracking is a mechanism by which we can keep track of previous sessions between server and the browser.
  • For creating the sessions getSession() method can be used.
  • This method returns the object which stores the bindings with the names that use this object.
  • These bindings

getAttribute()

can be managed using and

setAttribute()

methods.

6 of 7

Session Tracking

things are

  • In session tracking two playing an important role.
  • One is HttpServletRequest interface which supports getSession() method.
  • The another class is HttpSession class which supports the binding managing methods such as getAttribute() and setAttribute().

7 of 7

THANK YOU