sendredirect destroys session

Munteanu Gabriel <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <003e01c357b1$4e1d3230$4b5ae73e@serverxp>
Hi,

It's about sessions who "disappear" from one servlet to another.
I know that this has been discussed, but from what I have read
there was no good solution to this problem.
Here it goes:
I have apache 1.3.27 + mod_jk2 + tomcat 4.1.24. - on linux
I have one tomcat process runninng, one application, one context.

I have a servlet that in his doGet method works a little on the parameters
and then
response.sendredirect [ or dispatcher.forward - in this situation both have
the same effects] to another servlet.
I set some attributes in the first servlet and they disappear in the second
servlet - in fact the session is null
[I use request.getSession(false)].

After I read many messages on this subject, I tried to use
response.sendredirect(response.encodeRedirectURL(myservlet))
and it worked. BUT, in this second servlet I have other links to other
servlets. When I clicked on them, in the next servlets the session was gone
again.

Another trial was that I put it all on another linux, to a friend on my LAN.
He has apache 2.0.4x + mod_jk2 + tomcat 4.1.24.
It worked perfectly. - Also I noticed there was no need for
encodeRedirectURL

Then I installed tomcat 4.1.18 on my original linux, and also it worked in
the combination
I have apache 1.3.27 + mod_jk2 + tomcat 4.1.18. - on linux

So, I am sure that NO SERVLET OF MINE was to blame but the configurations of
the servers.

Can anybody tell me what configuration directive can be to blame for such
problems [in all the servers Apache, Linux, ...] ?

At what directives should I look in httpd.conf and server.xml?

Thank you in advance
Gabi

___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.