HttpSessionContext

Java Servlet Programming, 2nd Edition > B. HTTP Servlet API Quick Reference > HttpSessionContext

 
< BACKCONTINUE >
HttpSessionContext

Synopsis

Interface Name: javax.servlet.http.HttpSessionContext

Superinterface: None

Immediate Subinterfaces: None

Implemented By: None

Availability: Servlet API 2.0 and later; deprecated in Servlet API 2.1

Description

HttpSessionContext is deprecated as of Servlet API 2.1. Previously this class provided access to all of the currently active sessions inside the servlet container. This provided a potential security hole where a servlet could use this class to display all the session IDs found inside the context, and that information could then be used by unscrupulous clients to forge their way into another's session. Because the ability to access all sessions at once is almost never needed, this class was deprecated for security's sake.

Interface Declaration

public interface HttpSessionContext {   // Methods   public abstract Enumeration getIds();                     // Deprecated   public abstract HttpSession getSession(String sessionId); // Deprecated }

Methods

getIds()

public abstract Enumeration getIds()
Description

Deprecated as of Servlet API 2.1. In Servlet API 2.0, returns an Enumeration that contained the session IDs for all the currently valid sessions in this context, or an empty Enumeration if there are no valid sessions. The session IDs returned by getIds( ) must be held as a server secret because any client with knowledge of another client's session ID can, with a forged cookie or URL, join the second client's session.

getSession()

public abstract HttpSession getSession(String sessionId)
Description

Deprecated as of Servlet API 2.1. In Servlet API 2.0, returns the session associated with the given session identifier. A list of valid session IDs can be obtained from the getIds( ) method.


Last updated on 3/20/2003
Java Servlet Programming, 2nd Edition, © 2001 O'Reilly

< BACKCONTINUE >


Java servlet programming
Java Servlet Programming (Java Series)
ISBN: 0596000405
EAN: 2147483647
Year: 2000
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net