On Tue, 11 Sep 2001, naveen wrote:

> Date: Tue, 11 Sep 2001 14:51:14 +0900
> From: naveen <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: virual domain problems.
>
> hi,
> I have configured the DNS server which will direct all the virtual hosts of
> my domain to my web server.
>   The problem  is , when I am using virtual host to access my server, I
> loose all my session variables when I pass from one page to another.
> Should I configure virtual host parameter in tomcat also.
> I am using Tomcat and apache on Redhat machine.
> thanks
>

Web applications do *not* cross virtual host boundaries (even if you are
using the same context path and the same document root for each host).
Therefore, the sessions do not cross over either.  See the servlet spec:

  http://java.sun.com/products/servlet/download.html

(in 2.3, for example, see section 3.6).

You will need to use some other mechanism to share information across your
virtual hosts.  One approach might be to use a cookie that identifies a
database entry that contains the information you want to share.

Craig McClanahan

Reply via email to