Deprecated method(s) in HttpSession
843833May 13 2002 — edited May 15 2002Hi,
I need some information regarding HttpSession. I am working with JDK 1.2.2 and JSDK 2.0
In one of my classes i am trying to put a key - value pair in session and trying to get the same
whereever required in this fashion.
...
...
...
String MY_ID = "myid";
String Id = "100000000";
HttpSession newSession = pReq.getSession(true);
// putting id value in the session
newSession.putValue(MY_ID,Id);
// i am trying to get Id value in this fashion
HttpSession currentSession = pReq.getSession(false);
String id = (String)currentSession.getValue(MY_ID);
While Compiling i am getting one warning that i am using deprecated methods (putValue and getValue) on HttpSession object.
Are these methods deprecated ? If yes, what are other possible alternatvies to put and get
some data in session ?
I know cookies is one alternative which strikes to mind for such requirements. But i want
something other than cookies....
Thanks in advance,
Kishore