You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rajesh Harikrishnan <we...@sslindia.com> on 2002/05/10 09:09:31 UTC

Session Problem - URGENT!!!!

Hi All,

 I am having a problem with the session objects, let me first explain how we have used the session object in our application

we have an application which is initalizing an 'SESSION' object when the user log's into the system. 
This object is used to store three attributes, 
1) we have used 'session.setAttribute()' and 'session.setValue()' methods for creating key pair value objects in the session.
2) We have also used the 'session.getAttribute()' and 'session.getValue()' for retriving the data from the session object.
3) We have not used the 'session.removeAttribute()' any where in our application.
4) But in all pages, to check the session object validity, we have used 'request.getSession()'.

Does calling this creates a attribute set in a old session object to be incorrectly re-written?.

The problem:
We are getting this following problem randomly,

The session object exists, but the attributes inside the session object unbinds and returns a null value!!.


We are using 'Apache1.3.20+Tomcat3.2.2' for our application. we have also set our 'setMaxInactiveInterval(30000)' when creating the session object for the first time.

What is the cause of the attributes being removed from the session object, or in case is the session object itself is created as a new object during 'request.getSession()' calls and causing this problem.

Have you people faced similar problems??.

Please post your reply on this issue, this is a very urgent issue to be solved.

Thanks in advance

Regards
H.Rajesh
(webteam@sslindia.com)
SSPL,India

Re: Session Problem - URGENT!!!!

Posted by Paul Caton <pa...@mama.stg.brown.edu>.
I wish people would stop saying "URGENT!!!!" and "PLEASE HELP!!!!" in
their subject lines. Not only is is poor mailing-list manners, it is
also unnecessary. This being a user list, we assume that most people
posting have a problem they want to solve right away. Your problem is
not more urgent than anybody else's, and there's no reason why your's
should be given any kind of priority just because you shout.

Paul.

-- 
Paul Caton
Electronic Publications Editor
Women Writers Project

 e-mail: paul@mail.stg.brown.edu
    tel: (401) 863-3619
address: Box 1841, Brown University, Providence RI 02912

	


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Session Problem - URGENT!!!!

Posted by Jay Gardner <gj...@qwest.net>.
Hi Rajesh,

Are you using JSP or servlet? In the JSP the session object is implicitly
available to you. You do not need to set it up the same way that you do for
a servlet.


JSP Example:
String myvalue = "jgardner";
session.setAttribute("username", username);



Servlet Example:
HttpSession session = request.getSession(true);
session.setAttribute("username", username);

In both examples you do not need to set the key and value in a different
method. This is done with one call to setAttribute("mykey",myobject); When
you want to grab an object out of the session object, be sure to cast it to
the appropriate object type.

Example:
String username = (String) session.getAttribute("username");

By the way, the getValue() and setValue() methods have been deprecated.


Hope this helps!

--JG

-----Original Message-----
From: Rajesh Harikrishnan [mailto:webteam@sslindia.com]
Sent: Friday, May 10, 2002 1:10 AM
To: Tomcat Users List
Subject: Session Problem - URGENT!!!!

Hi All,

 I am having a problem with the session objects, let me first explain how we
have used the session object in our application

we have an application which is initalizing an 'SESSION' object when the
user log's into the system.
This object is used to store three attributes,
1) we have used 'session.setAttribute()' and 'session.setValue()' methods
for creating key pair value objects in the session.
2) We have also used the 'session.getAttribute()' and 'session.getValue()'
for retriving the data from the session object.
3) We have not used the 'session.removeAttribute()' any where in our
application.
4) But in all pages, to check the session object validity, we have used
'request.getSession()'.

Does calling this creates a attribute set in a old session object to be
incorrectly re-written?.

The problem:
We are getting this following problem randomly,

The session object exists, but the attributes inside the session object
unbinds and returns a null value!!.


We are using 'Apache1.3.20+Tomcat3.2.2' for our application. we have also
set our 'setMaxInactiveInterval(30000)' when creating the session object for
the first time.

What is the cause of the attributes being removed from the session object,
or in case is the session object itself is created as a new object during
'request.getSession()' calls and causing this problem.

Have you people faced similar problems??.

Please post your reply on this issue, this is a very urgent issue to be
solved.

Thanks in advance

Regards
H.Rajesh
(webteam@sslindia.com)
SSPL,India


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>