Jsessionid Problem

2004-11-24 Thread Arnab Chakravarty
Hi all,

We are running 2 tomcat instances, running 2 different applications. We
are making a switchover from tomcat 1 to tomcat 2 and in this process
loosing the session information on tomcat 1 this is resulting in error
(error page) in the application. 

I had disabled cookies and then again tried the switchover. This time it
was able to redirect well to tomcat 1 and seems that blocking cookies at
the browser level did not let the JSESSIONID cookie to be overridden on
tomcat 1.

I need to know, how I can avoid the JSESSIONID cookie (on tomcat 1) to
be overridden without disabling the 'block all cookie' option of the
browser.

I have added defaultcontext tag with cookies=false in the server.xml
under host but this does not seem to working. 

Any workarounds apart from removing the hard coded JSESSIONID in the
tomcat code base and recompilation of the same.

Thanks in Advance,
Arnab

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JSESSIONID problem.

2004-02-04 Thread Chugh, Sanjay
Thanks. I have changed the subject because it better reflects the
problem after some analysis. Thanks to Papillon for suggesting to use
burp proxy. However, now I am at a loss to explain the behaviour after
analyzing the log from burp proxy.
When I run IE on my box and target TomCat on my box, and I click on a
link in my app which launches another window, the http header is:

==
http://schughpc:8080  [10.32.2.41]
==
GET /Workplace/FormServlet?cmd=blankcontext=form HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/vnd.ms-powerpoint,
application/msword, application/x-shockwave-flash, */*
Referer:
http://localhost:8080/Workplace/properties/DocumentForm.jsp?policyObject
StoreName=eFormsobjectStoreName=eFormsvsId=%7B0A1D7877-B64B-4927-B698-
9642C6DB6B60%7DwindowId=56657policyId=%7B14CBF1E8-606C-4D7F-AE88-54033
5681DD7%7DreturnUrl=http%3A%2F%2Flocalhost%3A8080%2FWorkplace%2FWcmBrow
se.jsp%3FwindowId%3DmainWindowid=%7B8121190B-BF94-454D-92EB-2262A3FD71D
E%7D
Accept-Language: en-us
Proxy-Connection: Keep-Alive
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR
1.0.3705)
Host: schughpc:8080


==

Here you can see the JSESSIONID cookie is missing when it was present in
all the headers grabbed by burp proxy prior to this one.

When I run IE on another machine but still target TomCat on my machine,
the http header for the same request looks like:

==
http://schughpc:8080  [10.32.2.41]
==
GET /Workplace/FormServlet?cmd=blankcontext=form HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Referer:
http://schughpc:8080/Workplace/properties/DocumentForm.jsp?policyObjectS
toreName=eFormsobjectStoreName=eFormsvsId=%7B0A1D7877-B64B-4927-B698-9
642C6DB6B60%7DwindowId=87588policyId=%7B14CBF1E8-606C-4D7F-AE88-540335
681DD7%7DreturnUrl=http%3A%2F%2Fschughpc%3A8080%2FWorkplace%2FWcmBrowse
.jsp%3FwindowId%3DmainWindowid=%7B8121190B-BF94-454D-92EB-2262A3FD71DE%
7D
Accept-Language: en-us
Proxy-Connection: Keep-Alive
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR
1.0.3705)
Host: schughpc:8080
Cookie: JSESSIONID=68AF13A9B0FE3C8A200BDB594E753ECC


==

You can see the cookie is present.
The requests afterwards use this cookie and everything works fine.

However in the latter case (where the cookie is missing), the next
request receives a new cookie and everything starts falling apart.

IE on both machine is set up identically.

If anyone knows or has any suggestions as to the problem, it would be
much appreciated.

Thanks,

-- Sanjay


-Original Message-
From: Papillon [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 04, 2004 2:02 PM
To: Tomcat Users List
Subject: Re: Is this a Tomcat problem? Someone please point me in
theright direction to solve this problem...


Try burp proxy (Thanks again Mr Yansheng Lin) to see differences. Your
server have only one ip ? No NAT on your network ? WAN adress ? My
problem is not the same but perhaps it can help you in research :
http://www.mail-archive.com/[EMAIL PROTECTED]/msg117526.htm
l

Good luck ! 



 De : Chugh, Sanjay [EMAIL PROTECTED]
 Répondre à : Tomcat Users List [EMAIL PROTECTED]
Date 
 : Wed, 4 Feb 2004 12:43:40 -0700 À : Tomcat Users List 
 [EMAIL PROTECTED] Objet : Is this a Tomcat problem? 
 Someone please point me in the right direction to solve this 
 problem...
 
 I am part of a large team working on a java project with Tomcat. We 
 are using jdk1.3.1 and Tomcat 4.1.18. The problem is that the latest 
 build of our application has a problem on my machine. I've tracked it 
 down to what seems like a problem with the session. When code that 
 retreives information from the session is executed, it is not giving a

 valid result back. The part that I am having problem with is that it 
 is a problem only on my machine. In fact if I hit the Tomcat server on

 my machine from another machine on the network, then everything works 
 fine as well. The same is true if I hit the Tomcat server on my 
 machine from a virtual machine running also on my machine. It is only 
 when I run the application itself on my machine. I did just check one 
 other thing. That is I started IE on my machine but hit the tomcat 
 server on another physical machine. This time the application worked 
 fine on my machine. This is all very confusing, and I am at a loss to 
 explain what is is on my machine or my tomcat server that is causing a

 problem.
 
 I've compared the different machine configuration (they are all pretty

 similar). The Internet Explore options on all the machines are 
 identical.
 
 I would apreciate any ideas someone might have to offer.
 
 Thanks,
 

Re: JSESSIONID problem.

2004-02-04 Thread Papillon
You say both IE are sames but you seems to have two differents OS windows
XP(server 2003 ?) and windows 2000
You've a lot security problems with XP so with cookies too.
Try to set the security very low, accept all type of cookies temporaly to be
sure it's not a security's windows problem...

Papillon

 De : Chugh, Sanjay [EMAIL PROTECTED]
 Répondre à : Tomcat Users List [EMAIL PROTECTED]
 Date : Wed, 4 Feb 2004 15:52:46 -0700
 À : Tomcat Users List [EMAIL PROTECTED]
 Objet : JSESSIONID problem.
 
 Thanks. I have changed the subject because it better reflects the
 problem after some analysis. Thanks to Papillon for suggesting to use
 burp proxy. However, now I am at a loss to explain the behaviour after
 analyzing the log from burp proxy.
 When I run IE on my box and target TomCat on my box, and I click on a
 link in my app which launches another window, the http header is:
 
 ==
 http://schughpc:8080  [10.32.2.41]
 ==
 GET /Workplace/FormServlet?cmd=blankcontext=form HTTP/1.0
 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
 application/vnd.ms-excel, application/vnd.ms-powerpoint,
 application/msword, application/x-shockwave-flash, */*
 Referer:
 http://localhost:8080/Workplace/properties/DocumentForm.jsp?policyObject
 StoreName=eFormsobjectStoreName=eFormsvsId=%7B0A1D7877-B64B-4927-B698-
 9642C6DB6B60%7DwindowId=56657policyId=%7B14CBF1E8-606C-4D7F-AE88-54033
 5681DD7%7DreturnUrl=http%3A%2F%2Flocalhost%3A8080%2FWorkplace%2FWcmBrow
 se.jsp%3FwindowId%3DmainWindowid=%7B8121190B-BF94-454D-92EB-2262A3FD71D
 E%7D
 Accept-Language: en-us
 Proxy-Connection: Keep-Alive
 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR
 1.0.3705)
 Host: schughpc:8080
 
 
 ==
 
 Here you can see the JSESSIONID cookie is missing when it was present in
 all the headers grabbed by burp proxy prior to this one.
 
 When I run IE on another machine but still target TomCat on my machine,
 the http header for the same request looks like:
 
 ==
 http://schughpc:8080  [10.32.2.41]
 ==
 GET /Workplace/FormServlet?cmd=blankcontext=form HTTP/1.0
 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
 Referer:
 http://schughpc:8080/Workplace/properties/DocumentForm.jsp?policyObjectS
 toreName=eFormsobjectStoreName=eFormsvsId=%7B0A1D7877-B64B-4927-B698-9
 642C6DB6B60%7DwindowId=87588policyId=%7B14CBF1E8-606C-4D7F-AE88-540335
 681DD7%7DreturnUrl=http%3A%2F%2Fschughpc%3A8080%2FWorkplace%2FWcmBrowse
 .jsp%3FwindowId%3DmainWindowid=%7B8121190B-BF94-454D-92EB-2262A3FD71DE%
 7D
 Accept-Language: en-us
 Proxy-Connection: Keep-Alive
 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR
 1.0.3705)
 Host: schughpc:8080
 Cookie: JSESSIONID=68AF13A9B0FE3C8A200BDB594E753ECC
 
 
 ==
 
 You can see the cookie is present.
 The requests afterwards use this cookie and everything works fine.
 
 However in the latter case (where the cookie is missing), the next
 request receives a new cookie and everything starts falling apart.
 
 IE on both machine is set up identically.
 
 If anyone knows or has any suggestions as to the problem, it would be
 much appreciated.
 
 Thanks,
 
 -- Sanjay
 
 
 -Original Message-
 From: Papillon [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 04, 2004 2:02 PM
 To: Tomcat Users List
 Subject: Re: Is this a Tomcat problem? Someone please point me in
 theright direction to solve this problem...
 
 
 Try burp proxy (Thanks again Mr Yansheng Lin) to see differences. Your
 server have only one ip ? No NAT on your network ? WAN adress ? My
 problem is not the same but perhaps it can help you in research :
 http://www.mail-archive.com/[EMAIL PROTECTED]/msg117526.htm
 l
 
 Good luck ! 
 
 
 
 De : Chugh, Sanjay [EMAIL PROTECTED]
 Répondre à : Tomcat Users List [EMAIL PROTECTED]
 Date 
 : Wed, 4 Feb 2004 12:43:40 -0700 À : Tomcat Users List
 [EMAIL PROTECTED] Objet : Is this a Tomcat problem?
 Someone please point me in the right direction to solve this
 problem...
 
 I am part of a large team working on a java project with Tomcat. We
 are using jdk1.3.1 and Tomcat 4.1.18. The problem is that the latest
 build of our application has a problem on my machine. I've tracked it
 down to what seems like a problem with the session. When code that
 retreives information from the session is executed, it is not giving a
 
 valid result back. The part that I am having problem with is that it
 is a problem only on my machine. In fact if I hit the Tomcat server on
 
 my machine from another machine on the network, then everything works
 fine as well. The same is true if I hit the Tomcat server on my
 machine from a virtual machine running also on my machine. It is only
 when

RE: JSESSIONID problem. SP.AM

2004-02-04 Thread Chugh, Sanjay
Well, yes you are correct. Currently I have to use windows 2000 in
vmware for the second machine. But we have done the same thing with
windows xp on another developers machine hitting my tomcat, and that
works fine. His IE settings are the same as mine as well. I've tried
setting all the security settings on my IE to the lowest and told it to
accedpt all cookies, and still it does not work.
What I don't understand is when the new child popup window is opened by
clicking on the link (it uses window.open()), why do I loose the cookie?
And why does this only happen on my machine, and on no other developer,
that have the same OS and software.

-- Sanjay

-Original Message-
From: Papillon [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 04, 2004 5:42 PM
To: Tomcat Users List
Subject: Re: JSESSIONID problem. SP.AM


You say both IE are sames but you seems to have two differents OS
windows XP(server 2003 ?) and windows 2000 You've a lot security
problems with XP so with cookies too. Try to set the security very low,
accept all type of cookies temporaly to be sure it's not a security's
windows problem...

Papillon

 De : Chugh, Sanjay [EMAIL PROTECTED]
 Répondre à : Tomcat Users List [EMAIL PROTECTED] Date
 : Wed, 4 Feb 2004 15:52:46 -0700 À : Tomcat Users List 
 [EMAIL PROTECTED] Objet : JSESSIONID problem.
 
 Thanks. I have changed the subject because it better reflects the
 problem after some analysis. Thanks to Papillon for suggesting to use 
 burp proxy. However, now I am at a loss to explain the behaviour after

 analyzing the log from burp proxy. When I run IE on my box and target 
 TomCat on my box, and I click on a link in my app which launches 
 another window, the http header is:
 
 ==
 http://schughpc:8080  [10.32.2.41]
 ==
 GET /Workplace/FormServlet?cmd=blankcontext=form HTTP/1.0
 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, 
 application/vnd.ms-excel, application/vnd.ms-powerpoint, 
 application/msword, application/x-shockwave-flash, */*
 Referer: 
 http://localhost:8080/Workplace/properties/DocumentForm.jsp?policyObje
 ct

StoreName=eFormsobjectStoreName=eFormsvsId=%7B0A1D7877-B64B-4927-B698-

9642C6DB6B60%7DwindowId=56657policyId=%7B14CBF1E8-606C-4D7F-AE88-54033

5681DD7%7DreturnUrl=http%3A%2F%2Flocalhost%3A8080%2FWorkplace%2FWcmBrow

se.jsp%3FwindowId%3DmainWindowid=%7B8121190B-BF94-454D-92EB-2262A3FD71D
 E%7D
 Accept-Language: en-us
 Proxy-Connection: Keep-Alive
 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET
CLR
 1.0.3705)
 Host: schughpc:8080
 
 
 ==
 
 Here you can see the JSESSIONID cookie is missing when it was present
 in all the headers grabbed by burp proxy prior to this one.
 
 When I run IE on another machine but still target TomCat on my
 machine, the http header for the same request looks like:
 
 ==
 http://schughpc:8080  [10.32.2.41]
 ==
 GET /Workplace/FormServlet?cmd=blankcontext=form HTTP/1.0
 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
 Referer: 
 http://schughpc:8080/Workplace/properties/DocumentForm.jsp?policyObjec
 tS

toreName=eFormsobjectStoreName=eFormsvsId=%7B0A1D7877-B64B-4927-B698-9

642C6DB6B60%7DwindowId=87588policyId=%7B14CBF1E8-606C-4D7F-AE88-540335

681DD7%7DreturnUrl=http%3A%2F%2Fschughpc%3A8080%2FWorkplace%2FWcmBrowse

.jsp%3FwindowId%3DmainWindowid=%7B8121190B-BF94-454D-92EB-2262A3FD71DE%
 7D
 Accept-Language: en-us
 Proxy-Connection: Keep-Alive
 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET
CLR
 1.0.3705)
 Host: schughpc:8080
 Cookie: JSESSIONID=68AF13A9B0FE3C8A200BDB594E753ECC
 
 
 ==
 
 You can see the cookie is present.
 The requests afterwards use this cookie and everything works fine.
 
 However in the latter case (where the cookie is missing), the next
 request receives a new cookie and everything starts falling apart.
 
 IE on both machine is set up identically.
 
 If anyone knows or has any suggestions as to the problem, it would be
 much appreciated.
 
 Thanks,
 
 -- Sanjay
 
 
 -Original Message-
 From: Papillon [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 04, 2004 2:02 PM
 To: Tomcat Users List
 Subject: Re: Is this a Tomcat problem? Someone please point me in
 theright direction to solve this problem...
 
 
 Try burp proxy (Thanks again Mr Yansheng Lin) to see differences. Your
 server have only one ip ? No NAT on your network ? WAN adress ? My 
 problem is not the same but perhaps it can help you in research : 
 http://www.mail-archive.com/[EMAIL PROTECTED]/msg117526.h
 tm
 l
 
 Good luck !
 
 
 
 De : Chugh, Sanjay [EMAIL PROTECTED]
 Répondre à : Tomcat Users List [EMAIL PROTECTED]
 Date
 : Wed, 4 Feb 2004 12:43:40 -0700 À : Tomcat

Re: JSessionID problem

2003-11-07 Thread inaminute
Quoting Thyago Lisboa Mota [EMAIL PROTECTED]:

 Hi, 
 
 I am facing a problem with jsessionid and I hope u guys can help me.  I
 have 2 tomcat (4.1.29 version) configurations, one at W2K (for develop) and
 another at Linux Red Hat (for production).  The W2K one is working just fine.
  But with the Linux one I always receive the same ID for the jsessionid, no
 matter how many times I refresh the page.  Bellow is the JSP scriptlet I am
 using for test purpose (file Session.jsp saved at webapps\ROOT ): 
 
 %
  out.println(Session ID:  + session);
  out.println(BRDate:  + session.getAttribute(date));
  session.setAttribute(date, new java.util.Date());
  out.println(bra href=\ + response.encodeURL(session.jsp) + \Click
 here/a);
 %

Provided you have this declared in your JSP:

%@ page language=java import=java.util.Date, java.util.Enumeration %

You might try to get session info with the following scriptlet:

%

// print session info

Date created = new Date(session.getCreationTime());
Date accessed = new Date(session.getLastAccessedTime());
out.print(ID:  + session.getId() + br /);
out.print(Created:  + created + br /);
out.print(Last Accessed:  + accessed + br /);
out.print(br /Attribute names : br /);

Enumeration e = session.getAttributeNames();
while (e.hasMoreElements()) {
out.print(e.nextElement() + br /);
}
%

 
   If I test this code from the Linux Tomcat Server (just typing
 http://myserver/session.jsp ) jsessionid doesn´t change each time a refresh
 the page... 
Isn't it the way it should work ? Keeping a single session between requests ? 
But I only have RedHat Linux, for dev. and prod. ;)

And the link doesnt show jsessionid either, as should (notice the
 encodeURL)
 
   The configuration files (server.xml) of Tomcats are the same in both
 plattaforms. The only difference is the attribute appbase of the host element
 (/var/www/webapps at Linux). 
 
   Any clues ? 
 
 Thyago
 
 My server.xml: 
 
 Server
  port=8005
  shutdown=SHUTDOWN
debug=0
 
  Service name=Tomcat-Standalone
 
  Connector
   className=org.apache.coyote.tomcat4.CoyoteConnector
port=8080
minProcessors=5
maxProcessors=75
enableLookups=true
redirectPort=8443
acceptCount=100
debug=0
connectionTimeout=2
useURIValidationHack=false
disableUploadTimeout=true /
 
  Engine
name=Standalone
  defaultHost=localhost
  debug=0
 
Host
 name=localhost
 debug=0
 appBase=d:\webapps 
  unpackWARs=false
 autoDeploy=true
 
 Context
path=
docBase=raiz
debug=0
reloadable=true
crossContext=true /
 
/Host
 /Engine
  /Service
 /Server
 
 
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: JSessionID problem

2003-11-07 Thread Tatu Vanhanen

If I test this code from the Linux Tomcat Server (just typing
  http://myserver/session.jsp ) jsessionid doesn´t change each
 time a refresh
  the page...
 Isn't it the way it should work ? Keeping a single session
 between requests ?

I agree.

 And the link doesnt show jsessionid either, as should (notice the
  encodeURL)

If your browser does not block cookies, then the jsessionid is not put to
the link, but to a cookie, right? Try to disable cookies and see if the
sessioid appears to the link.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSessionID problem

2003-11-07 Thread Thyago Lisboa Mota
I thought the jsessionid had to be encoded in the URL (using
response.encodeURL(...)) to work like you say... If I just type
http://myserver/session.jsp I thought a new session would be created each
time.  So, the server controls the session using information from the client
browser ?

So, if the Linux server is working just fine, the problem is with the W2K
one, that is creating a new jsession each time I refresh the page... How can
I fix this ?

Thanks for your help

Thyago

- Original Message -
From: [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]; Thyago Lisboa
Mota [EMAIL PROTECTED]
Sent: Friday, November 07, 2003 6:35 AM
Subject: Re: JSessionID problem


 Quoting Thyago Lisboa Mota [EMAIL PROTECTED]:

  Hi,
 
  I am facing a problem with jsessionid and I hope u guys can help me.
I
  have 2 tomcat (4.1.29 version) configurations, one at W2K (for develop)
and
  another at Linux Red Hat (for production).  The W2K one is working just
fine.
   But with the Linux one I always receive the same ID for the jsessionid,
no
  matter how many times I refresh the page.  Bellow is the JSP scriptlet I
am
  using for test purpose (file Session.jsp saved at webapps\ROOT ):
 
  %
   out.println(Session ID:  + session);
   out.println(BRDate:  + session.getAttribute(date));
   session.setAttribute(date, new java.util.Date());
   out.println(bra href=\ + response.encodeURL(session.jsp) +
\Click
  here/a);
  %

 Provided you have this declared in your JSP:

 %@ page language=java import=java.util.Date, java.util.Enumeration %

 You might try to get session info with the following scriptlet:

 %

 // print session info

 Date created = new Date(session.getCreationTime());
 Date accessed = new Date(session.getLastAccessedTime());
 out.print(ID:  + session.getId() + br /);
 out.print(Created:  + created + br /);
 out.print(Last Accessed:  + accessed + br /);
 out.print(br /Attribute names : br /);

 Enumeration e = session.getAttributeNames();
 while (e.hasMoreElements()) {
 out.print(e.nextElement() + br /);
 }
 %

 
If I test this code from the Linux Tomcat Server (just typing
  http://myserver/session.jsp ) jsessionid doesn´t change each time a
refresh
  the page...
 Isn't it the way it should work ? Keeping a single session between
requests ?
 But I only have RedHat Linux, for dev. and prod. ;)

 And the link doesnt show jsessionid either, as should (notice the
  encodeURL)
 
The configuration files (server.xml) of Tomcats are the same in both
  plattaforms. The only difference is the attribute appbase of the host
element
  (/var/www/webapps at Linux).
 
Any clues ?
 
  Thyago
 
  My server.xml:
 
  Server
   port=8005
   shutdown=SHUTDOWN
 debug=0
 
   Service name=Tomcat-Standalone
 
   Connector
className=org.apache.coyote.tomcat4.CoyoteConnector
 port=8080
 minProcessors=5
 maxProcessors=75
 enableLookups=true
 redirectPort=8443
 acceptCount=100
 debug=0
 connectionTimeout=2
 useURIValidationHack=false
 disableUploadTimeout=true /
 
   Engine
 name=Standalone
   defaultHost=localhost
   debug=0
 
 Host
  name=localhost
  debug=0
  appBase=d:\webapps
   unpackWARs=false
  autoDeploy=true
 
  Context
 path=
 docBase=raiz
 debug=0
 reloadable=true
 crossContext=true /
 
 /Host
  /Engine
   /Service
  /Server
 
 
 






Re: JSessionID problem

2003-11-07 Thread Thyago Lisboa Mota

- Original Message -
From: [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]; Thyago Lisboa
Mota [EMAIL PROTECTED]
Sent: Friday, November 07, 2003 6:35 AM
Subject: Re: JSessionID problem


 Quoting Thyago Lisboa Mota [EMAIL PROTECTED]:

  Hi,
 
  I am facing a problem with jsessionid and I hope u guys can help me.
I
  have 2 tomcat (4.1.29 version) configurations, one at W2K (for develop)
and
  another at Linux Red Hat (for production).  The W2K one is working just
fine.
   But with the Linux one I always receive the same ID for the jsessionid,
no
  matter how many times I refresh the page.  Bellow is the JSP scriptlet I
am
  using for test purpose (file Session.jsp saved at webapps\ROOT ):
 
  %
   out.println(Session ID:  + session);
   out.println(BRDate:  + session.getAttribute(date));
   session.setAttribute(date, new java.util.Date());
   out.println(bra href=\ + response.encodeURL(session.jsp) +
\Click
  here/a);
  %

 Provided you have this declared in your JSP:

 %@ page language=java import=java.util.Date, java.util.Enumeration %

 You might try to get session info with the following scriptlet:

 %

 // print session info

 Date created = new Date(session.getCreationTime());
 Date accessed = new Date(session.getLastAccessedTime());
 out.print(ID:  + session.getId() + br /);
 out.print(Created:  + created + br /);
 out.print(Last Accessed:  + accessed + br /);
 out.print(br /Attribute names : br /);

 Enumeration e = session.getAttributeNames();
 while (e.hasMoreElements()) {
 out.print(e.nextElement() + br /);
 }
 %

 
If I test this code from the Linux Tomcat Server (just typing
  http://myserver/session.jsp ) jsessionid doesn´t change each time a
refresh
  the page...
 Isn't it the way it should work ? Keeping a single session between
requests ?
 But I only have RedHat Linux, for dev. and prod. ;)

I thought the jsessionid had to be encoded in the URL (using
response.encodeURL(...)) to work like you say... If I just type
http://myserver/session.jsp I thought a new session would be created each
time.  So, the server controls the session using information from the client
browser ?

So, if the Linux server is working just fine, the problem is with the W2K
one, that is creating a new jsession each time I refresh the page... How can
I fix this ?

Thanks for your help

Thyago


 And the link doesnt show jsessionid either, as should (notice the
  encodeURL)
 
The configuration files (server.xml) of Tomcats are the same in both
  plattaforms. The only difference is the attribute appbase of the host
element
  (/var/www/webapps at Linux).
 
Any clues ?
 
  Thyago
 
  My server.xml:
 
  Server
   port=8005
   shutdown=SHUTDOWN
 debug=0
 
   Service name=Tomcat-Standalone
 
   Connector
className=org.apache.coyote.tomcat4.CoyoteConnector
 port=8080
 minProcessors=5
 maxProcessors=75
 enableLookups=true
 redirectPort=8443
 acceptCount=100
 debug=0
 connectionTimeout=2
 useURIValidationHack=false
 disableUploadTimeout=true /
 
   Engine
 name=Standalone
   defaultHost=localhost
   debug=0
 
 Host
  name=localhost
  debug=0
  appBase=d:\webapps
   unpackWARs=false
  autoDeploy=true
 
  Context
 path=
 docBase=raiz
 debug=0
 reloadable=true
 crossContext=true /
 
 /Host
  /Engine
   /Service
  /Server
 
 
 





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JSessionID problem

2003-11-06 Thread Thyago Lisboa Mota
Hi, 

I am facing a problem with jsessionid and I hope u guys can help me.  I have 2 
tomcat (4.1.29 version) configurations, one at W2K (for develop) and another at Linux 
Red Hat (for production).  The W2K one is working just fine.  But with the Linux one I 
always receive the same ID for the jsessionid, no matter how many times I refresh the 
page.  Bellow is the JSP scriptlet I am using for test purpose (file Session.jsp 
saved at webapps\ROOT ): 

%
 out.println(Session ID:  + session);
 out.println(BRDate:  + session.getAttribute(date));
 session.setAttribute(date, new java.util.Date());
 out.println(bra href=\ + response.encodeURL(session.jsp) + \Click 
here/a);
%

  If I test this code from the Linux Tomcat Server (just typing 
http://myserver/session.jsp ) jsessionid doesn´t change each time a refresh the 
page... And the link doesnt show jsessionid either, as should (notice the encodeURL)

  The configuration files (server.xml) of Tomcats are the same in both plattaforms. 
The only difference is the attribute appbase of the host element (/var/www/webapps 
at Linux). 

  Any clues ? 

Thyago

My server.xml: 

Server
 port=8005
 shutdown=SHUTDOWN
   debug=0

 Service name=Tomcat-Standalone

 Connector
  className=org.apache.coyote.tomcat4.CoyoteConnector
   port=8080
   minProcessors=5
   maxProcessors=75
   enableLookups=true
   redirectPort=8443
   acceptCount=100
   debug=0
   connectionTimeout=2
   useURIValidationHack=false
   disableUploadTimeout=true /

 Engine
   name=Standalone
 defaultHost=localhost
 debug=0

   Host
name=localhost
debug=0
appBase=d:\webapps 
 unpackWARs=false
autoDeploy=true

Context
   path=
   docBase=raiz
   debug=0
   reloadable=true
   crossContext=true /

   /Host
/Engine
 /Service
/Server




jsessionid problem

2003-02-11 Thread vivek karkun
Hello everyone,

I am facing problems with the jsessionid when using
stronghold(apache 1.3) and tomcat 4.1.18 using the
mod_jk module 

on solaris 8. 

The way things are laid out on the server are as
follows

1. The entire doc tree is flat html
2. a couple of jsps and servlets used for shopping
cart and checkout.

when i delete my cookie file and  go to ww.mytest.com,
the index page comes up fine, but on the index page
there are a couple of urls like this
http://www.mytest.com/y/z and when i click this i get
a broken page(404) error with the url like this
http://www.mytest.com/x/y/;jsessionid=1E84A042615444560A5E25DF8D277267.
However when i go back and click the same url or any
url on the index page everything works fine, infact
all the urls now show up like this 
http://www.mytest.com/x/y or http://mytest.com/a/b. 

My guess is intially the cookie wants to set the
value, and that is the reason i am getting an error,
and once the value is set all the links work fine, but
its only the intial click from the index page that is
a problem. Also i tried the whole url rewrite thing on
strongohld but it never worked. Also since all the
front end stuff is flat html i am kind if tied up.

Am i missing anything here. Thanks in advance for any
help

vic

__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: jsessionid problem

2003-02-11 Thread Zabel, Ian
Are you using mod_jk? And maybe an older version?

Older versions of mod_jk had trouble with URLs that include the ; in them,
but the newer ones work fine.

Ian.

-Original Message-
From: vivek karkun [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, February 11, 2003 11:41 AM
To: [EMAIL PROTECTED]
Subject: jsessionid problem

when i delete my cookie file and  go to ww.mytest.com,
the index page comes up fine, but on the index page
there are a couple of urls like this
http://www.mytest.com/y/z and when i click this i get
a broken page(404) error with the url like this
http://www.mytest.com/x/y/;jsessionid=1E84A042615444560A5E25DF8D277267.
However when i go back and click the same url or any
url on the index page everything works fine, infact
all the urls now show up like this 
http://www.mytest.com/x/y or http://mytest.com/a/b. 



RE: jsessionid problem

2003-02-11 Thread vivek karkun

i am using the precomplied mod_jk for solaris 8 whcih
was available a few days back. Would there be some
trick that i could use in httpd.conf file for url
rewrting?


--- Zabel, Ian [EMAIL PROTECTED] wrote:
 Are you using mod_jk? And maybe an older version?
 
 Older versions of mod_jk had trouble with URLs that
 include the ; in them,
 but the newer ones work fine.
 
 Ian.
 
 -Original Message-
 From: vivek karkun [mailto:[EMAIL PROTECTED]] 
 Sent: Tuesday, February 11, 2003 11:41 AM
 To: [EMAIL PROTECTED]
 Subject: jsessionid problem
 
 when i delete my cookie file and  go to
 ww.mytest.com,
 the index page comes up fine, but on the index page
 there are a couple of urls like this
 http://www.mytest.com/y/z and when i click this i
 get
 a broken page(404) error with the url like this

http://www.mytest.com/x/y/;jsessionid=1E84A042615444560A5E25DF8D277267.
 However when i go back and click the same url or any
 url on the index page everything works fine, infact
 all the urls now show up like this 
 http://www.mytest.com/x/y or http://mytest.com/a/b. 
 


__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: jsessionid problem

2003-02-11 Thread Zabel, Ian
You may benefit from this thread:

http://groups.google.com/groups?hl=enlr=ie=UTF-8oe=UTF-8frame=rightth=6
59de1293fa4e814seekm=92dh6a%2472j%2403%241%40news.t-online.com#link4


If that's not one long URL, you'll need to copy and paste all three lines
together into your browser to get the link.
Ian.

-Original Message-
From: vivek karkun [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, February 11, 2003 12:07 PM
To: Tomcat Users List
Subject: RE: jsessionid problem


i am using the precomplied mod_jk for solaris 8 whcih
was available a few days back. Would there be some
trick that i could use in httpd.conf file for url
rewrting?


--- Zabel, Ian [EMAIL PROTECTED] wrote:
 Are you using mod_jk? And maybe an older version?
 
 Older versions of mod_jk had trouble with URLs that
 include the ; in them,
 but the newer ones work fine.
 
 Ian.
 
 -Original Message-
 From: vivek karkun [mailto:[EMAIL PROTECTED]] 
 Sent: Tuesday, February 11, 2003 11:41 AM
 To: [EMAIL PROTECTED]
 Subject: jsessionid problem
 
 when i delete my cookie file and  go to
 ww.mytest.com,
 the index page comes up fine, but on the index page
 there are a couple of urls like this
 http://www.mytest.com/y/z and when i click this i
 get
 a broken page(404) error with the url like this

http://www.mytest.com/x/y/;jsessionid=1E84A042615444560A5E25DF8D277267.
 However when i go back and click the same url or any
 url on the index page everything works fine, infact
 all the urls now show up like this 
 http://www.mytest.com/x/y or http://mytest.com/a/b. 
 


__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: jsessionid problem

2003-02-11 Thread Chong, Kwong

We had the same problem while deploying our application running
apache/tomcat.

As I understand it, during the first transaction of any session, 
there are no cookies to maintain session information, so tomcat 
appends the session ID in the URL.  The problem then is apache 
does not recognise session IDs; the dynamic components which apache 
normally sends off to tomcat work fine, but normal images and static
html which apache normally serves will result in errors.

Our solution was to strip off the session ID off static content 
so that apache can still serve them; we did this by

RewriteRule (.*[gif|jpg|html])\;jsessionid.*$ $1 [R]

There might be a better way to do this as that rule will mean a 
double hit on apache for every static request containing a 
session ID - first hit GET
/index.html;jsessionid=1E84A042615444560A5E25DF8D277267 which is rewritten
to 
GET /index.html

The other solution below means that tomcat will also be made to serve static
content which have the session ID attached (more work for your app server or
more work for your webserver, assuming you have a multi tiered environment).

Kwong.

-Original Message-
From: Zabel, Ian [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 12 February 2003 4:14
To: 'Tomcat Users List'
Subject: RE: jsessionid problem


You may benefit from this thread:

http://groups.google.com/groups?hl=enlr=ie=UTF-8oe=UTF-8frame=rightth=6
59de1293fa4e814seekm=92dh6a%2472j%2403%241%40news.t-online.com#link4


If that's not one long URL, you'll need to copy and paste all three lines
together into your browser to get the link.
Ian.

-Original Message-
From: vivek karkun [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, February 11, 2003 12:07 PM
To: Tomcat Users List
Subject: RE: jsessionid problem


i am using the precomplied mod_jk for solaris 8 whcih
was available a few days back. Would there be some
trick that i could use in httpd.conf file for url
rewrting?


--- Zabel, Ian [EMAIL PROTECTED] wrote:
 Are you using mod_jk? And maybe an older version?
 
 Older versions of mod_jk had trouble with URLs that
 include the ; in them,
 but the newer ones work fine.
 
 Ian.
 
 -Original Message-
 From: vivek karkun [mailto:[EMAIL PROTECTED]] 
 Sent: Tuesday, February 11, 2003 11:41 AM
 To: [EMAIL PROTECTED]
 Subject: jsessionid problem
 
 when i delete my cookie file and  go to
 ww.mytest.com,
 the index page comes up fine, but on the index page
 there are a couple of urls like this
 http://www.mytest.com/y/z and when i click this i
 get
 a broken page(404) error with the url like this

http://www.mytest.com/x/y/;jsessionid=1E84A042615444560A5E25DF8D277267.
 However when i go back and click the same url or any
 url on the index page everything works fine, infact
 all the urls now show up like this 
 http://www.mytest.com/x/y or http://mytest.com/a/b. 
 


__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

www.sensis.com.au

A leading Australian advertising, information 
and directories business. 

www.yellowpages.com.au
www.whitepages.com.au
www.citysearch.com.au
www.whereis.com.au
www.telstra.com.au

This email and any attachments are intended only for the use of the recipient and may 
be confidential and/or legally privileged.
Sensis Pty Ltd disclaims liability for any errors, omissions, viruses, loss and/or 
damage arising from using, opening or transmitting this email.
If you are not the intended recipient you must not use, interfere with, disclose, copy 
or retain this email and you should notify the sender immediately by return email or 
by contacting Sensis Pty Ltd by telephone on [+61 3 9201 4888]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: jsessionid problem with a new window (HTA)

2002-12-20 Thread Ralph Einfeldt
I can't see anything wrong at the first glance.

Some recommendations:

Try to use 
do_submit_popup(%= response.encodeUrl(Action) %, 'foo', 'bar' );

instead of generating the encoded url in do_submit_popup.

Print out the requested sessionId to see if it is the same
as the one that was used to create the window.

 -Original Message-
 From: Yong Wang [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 19, 2002 5:20 PM
 To: Tomcat Users List
 Subject: RE: jsessionid problem with a new window (HTA)
 
 
 Hi Ralph, the js function gets included into the JSP
 page and it looks something like the following. Do you
 see anything wrong?
 
 % final String currentSessionID = session.getId(); %
 ...
 function do_submit_popup(newAction, submitType,
 targetFrame)
   {
 var newAction2 = newAction + \;jsessionid= +
 %=currentSessionID%;
 
 do_submit( newAction2, submitType, 'newWindow' );
   }
 

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




jsessionid problem with a new window (HTA)

2002-12-19 Thread Yong Wang
Hi, I have a web application running on Tomcat 4.1 and
has to support both regular browser and HTA. On one of
the pages, I need to pop up a new window to display a
PDF file generated by a servlet. The servlet needs to
use some information stored in the session to generate
the PDF content. So this new window has to use the
same session as the original window. I use a
javascript o append the jsessionid to the end of the
URL as such:

javascript:window.parent.do_submit_popup('PrintReport',null,'_new');

which produces something like:

http://localhost:8080/dms/do/PrintReport;jsessionid=CE368CD99D2E46099FDDC39A4920CE55

The problem is occassionally, the new popup window
would somehow be assigned a new session and therefore
can't access the information expected in the original
session. This problem is so transient that it would
occur all of sudden and then go away a while later.

I would appreciate any hint or insight on this issue.
Pls let me know if you need any other info. Thanks!


=

// My alternate email: [EMAIL PROTECTED]


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: jsessionid problem with a new window (HTA)

2002-12-19 Thread Ralph Einfeldt
How do yo create the url.

I guess it's inside do_submit_popup.

Is this function part of the local page or part of an
external js file ?

Why don't you just use:
javascript:window.parent.do_submit_popup('%= response.encodeUrl(PrintReport) 
%',null,'_new');

 -Original Message-
 From: Yong Wang [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 19, 2002 4:59 PM
 To: [EMAIL PROTECTED]
 Subject: jsessionid problem with a new window (HTA)
 
 I use a javascript o append the jsessionid to the end of the
 URL as such:
 
 javascript:window.parent.do_submit_popup('PrintReport',null,'_new');
 
 which produces something like:
 

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: jsessionid problem with a new window (HTA)

2002-12-19 Thread Yong Wang
Hi Ralph, the js function gets included into the JSP
page and it looks something like the following. Do you
see anything wrong?

% final String currentSessionID = session.getId(); %
...
function do_submit_popup(newAction, submitType,
targetFrame)
  {
var newAction2 = newAction + \;jsessionid= +
%=currentSessionID%;

do_submit( newAction2, submitType, 'newWindow' );
  }

function do_submit(newAction, submitType, targetFrame)
  {
  if ( window.document.frames[0] != null)
  {
  formObj =
window.document.frames[0].document.forms[0];
  }
  else
  {
  formObj = window.document.forms[0];
  }
  if (formObj)
  {
  if ( targetFrame != null )
  {
  formObj.target = targetFrame;
  }
  if ( submitType != null )
  {
 if ( formObj.$submitType )
 {
 formObj.$submitType.value =
submitType;
 }
  }
  if (newAction != null)
  {
  formObj.action=newAction;
  }

  e = formObj.elements;
  for (i=0; ie.length; i++)
  {
  if ( e[i].type == checkbox )
  {
  cbox = e[i];
  if ( cbox.checked )
  {
 cbox.value=%=
DropDownListHelper.CHECKED %;
 }
 else
 {
 var output = input
type='hidden' name=' + cbox.name + ' value='%=
DropDownListHelper.UNCHECKED %' ;

cbox.insertAdjacentHTML(AfterEnd, output);
 }
  }
  }
  if ( formObj.fireEvent(onsubmit) )
  {
  formObj.submit();
  }
  //}
  }
  else
  {
  //alert(window.location.pathname );
  window.location.href = newAction;
  }
  }


--- Ralph Einfeldt [EMAIL PROTECTED]
wrote:
 How do yo create the url.
 
 I guess it's inside do_submit_popup.
 
 Is this function part of the local page or part of
 an
 external js file ?
 
 Why don't you just use:
 javascript:window.parent.do_submit_popup('%=
 response.encodeUrl(PrintReport) %',null,'_new');
 
  -Original Message-
  From: Yong Wang [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, December 19, 2002 4:59 PM
  To: [EMAIL PROTECTED]
  Subject: jsessionid problem with a new window
 (HTA)
  
  I use a javascript o append the jsessionid to the
 end of the
  URL as such:
  
 

javascript:window.parent.do_submit_popup('PrintReport',null,'_new');
  
  which produces something like:
  
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 


=

// My alternate email: [EMAIL PROTECTED]


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]