Re: Problem with sessions on a fedora 10 machine
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Noam, On 2/24/2009 5:22 PM, Noam Aigerman wrote: Hi Chris, I managed to isolate the issue - you were close with your last guess :) - in proxy_ajp.conf I mapped my webapp by doing: ProxyPass / ajp://localhost:8009/Noam So whoever comes to my site can go to www.site.com and not www.site.com/Noam I am guessing the cookies are set to a wrong domain. What should I do? And is this kind of mapping the wrong way to do it in the first place? So, your webapp thinks that the context path is /Noam instead of /. The cookie will be set to host=www.site.com, path=/Noam. When your browser sends further requests to /, the cookie is not included because the path doesn't match. You can do one of two things: 1) Tell Tomcat to use an empty session path on your connector (see http://tomcat.apache.org/tomcat-5.5-doc/config/ajp.html or http://tomcat.apache.org/tomcat-5.5-doc/config/http.html) 2) Deploy your application under the ROOT context instead (use ROOT.war or webapps/ROOT directory for deployment). I favor #2 because then you won't forget that you have server-wide configuration supporting a single webapp. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkmm2lsACgkQ9CaO5/Lv0PBATACcCMwYGrFrTH2gE+v5PopabGPV CDcAoLUQG/uOi8jDJv3/EFQIoTCnrioh =6PFj -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Problem with sessions on a fedora 10 machine
Hi, I've been working with apache tomcat under windows for a few months now. I've just setup a new fedora server, and deployed a .war file to it's webapps directory. Everything is running fine on the fedora machine, except that the session doesn't seem to stick. doing something like the code below in my Servlet: String check=session.getAttribute(check); System.out.println(this is what I got: + check); session.setAttribute(check,one); And then going to that servlet's page and refreshing or navigating back and forth form it create the following output in catalina.out: this is what I got: null this is what I got: null this is what I got: null this is what I got: null checking the tomcat catalina logs, there are no errors present... web.xml has a timeout of 30... Under MS it all works great... Any thoughts? Thanks, Noma
Re: Problem with sessions on a fedora 10 machine
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Noam, On 2/24/2009 2:06 PM, Noam Aigerman wrote: I've been working with apache tomcat under windows for a few months now. I've just setup a new fedora server, and deployed a .war file to it's webapps directory. Everything is running fine on the fedora machine, except that the session doesn't seem to stick. doing something like the code below in my Servlet: String check=session.getAttribute(check); System.out.println(this is what I got: + check); session.setAttribute(check,one); How do you acquire the session object in the first place? Are you using cookies or URL rewriting? Have you done an HTTP capture using LiveHttpHeaders (or similar) or a TCP dump using Wireshark (or similar)? I wonder if the cookie is being set to a domain like www.foo.com but your are using 'localhost' to access the webapp. This will cause your browser to fail to send cookies back to the server on subsequent requests. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkmkbgUACgkQ9CaO5/Lv0PDXUwCfUVCeAWe7S4JlBlIYqGhx57kC 0XEAoLXpxrcTD5tNb4YpPXjVBZG5JaNa =PGmv -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Problem with sessions on a fedora 10 machine
Hi Chris, I managed to isolate the issue - you were close with your last guess :) - in proxy_ajp.conf I mapped my webapp by doing: ProxyPass / ajp://localhost:8009/Noam So whoever comes to my site can go to www.site.com and not www.site.com/Noam I am guessing the cookies are set to a wrong domain. What should I do? And is this kind of mapping the wrong way to do it in the first place? Thanks, Noam -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Wednesday, February 25, 2009 12:01 AM To: Tomcat Users List Subject: Re: Problem with sessions on a fedora 10 machine -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Noam, On 2/24/2009 2:06 PM, Noam Aigerman wrote: I've been working with apache tomcat under windows for a few months now. I've just setup a new fedora server, and deployed a .war file to it's webapps directory. Everything is running fine on the fedora machine, except that the session doesn't seem to stick. doing something like the code below in my Servlet: String check=session.getAttribute(check); System.out.println(this is what I got: + check); session.setAttribute(check,one); How do you acquire the session object in the first place? Are you using cookies or URL rewriting? Have you done an HTTP capture using LiveHttpHeaders (or similar) or a TCP dump using Wireshark (or similar)? I wonder if the cookie is being set to a domain like www.foo.com but your are using 'localhost' to access the webapp. This will cause your browser to fail to send cookies back to the server on subsequent requests. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkmkbgUACgkQ9CaO5/Lv0PDXUwCfUVCeAWe7S4JlBlIYqGhx57kC 0XEAoLXpxrcTD5tNb4YpPXjVBZG5JaNa =PGmv -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
problem with sessions
hi every one, i have a jsp page, once the user logged in iam creating a session in the jsp page.When the user logged out iam invalidating the session. when two users logged in, and if one user logged out, the other user session is also getting invalidated.I dont want this to happen i.e. evethough the first user logged out second can continue his work. Can any one tell me how to solve this problem? here is the code.. once the user logged in, he will move to session.jsp page session.jsp page code: div align='left'a href=logout.jspLogout/aa href=compose.jspCompose/a/div BR % out.println(Is session new ?+session.isNew()+BR); out.println(session id=+session.getId()); session.setAttribute(check,check); % once the user click the logout link, he will be logged out and session will be invalidated logout.jsp page code: % session.invalidate(); out.println(Session Invalidated..); % here is the compose page, here iam checking the varaibale set in session.if it is null iam forwarding back to login page. code: % String check=(String)session.getAttribute(check); if (check==null) { % jsp:forward page=slogin.jsp jsp:param name=memid value= / /jsp:forward % } else { out.println(Session exists proceed to do the work); } % the problem comes when i open a new window from an existing window. i.e. for example , i have opened a new window and typed the login page url. now i opened another window from an exisitng window using control+N option. like wise i opened three windows. So, when i open the windows in this fashion, session created in the main window will be same in all the windows that opened thru control+N option. So, when the user logged out from any one of the windows, session will be invalidated in all the windows.. tell me how to sort this problem. -- Abhishek - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with sessions
Hello Abhishek, if you open a new window in a browser (except internet explorer with setting start new window in new process = on) your new window belongs to the same process as the old window, sharing all the states, including session cookies. So both windows are tied to the same session. If you want to have multiple sessions: - use different browsers (firefox 3, firefx 2, netscape 9 (which is firefox), flock, mozilla, camino, ie, safari) - if you use internet explorer - set the above setting to true - define multiple virtual hosts in /etc/hosts 127.0.0.1 localhost myhost1 myhost2 myhost3, and use them in different windows. regards Leon P.S. on a side note, doing all that in a jsp is rather outdated, try to use a decent web framework and avoid scriptlets. On Fri, Jun 27, 2008 at 8:05 AM, abhishek reddy [EMAIL PROTECTED] wrote: hi every one, i have a jsp page, once the user logged in iam creating a session in the jsp page.When the user logged out iam invalidating the session. when two users logged in, and if one user logged out, the other user session is also getting invalidated.I dont want this to happen i.e. evethough the first user logged out second can continue his work. Can any one tell me how to solve this problem? here is the code.. once the user logged in, he will move to session.jsp page session.jsp page code: div align='left'a href=logout.jspLogout/aa href=compose.jspCompose/a/div BR % out.println(Is session new ?+session.isNew()+BR); out.println(session id=+session.getId()); session.setAttribute(check,check); % once the user click the logout link, he will be logged out and session will be invalidated logout.jsp page code: % session.invalidate(); out.println(Session Invalidated..); % here is the compose page, here iam checking the varaibale set in session.if it is null iam forwarding back to login page. code: % String check=(String)session.getAttribute(check); if (check==null) { % jsp:forward page=slogin.jsp jsp:param name=memid value= / /jsp:forward % } else { out.println(Session exists proceed to do the work); } % the problem comes when i open a new window from an existing window. i.e. for example , i have opened a new window and typed the login page url. now i opened another window from an exisitng window using control+N option. like wise i opened three windows. So, when i open the windows in this fashion, session created in the main window will be same in all the windows that opened thru control+N option. So, when the user logged out from any one of the windows, session will be invalidated in all the windows.. tell me how to sort this problem. -- Abhishek - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with sessions
Hi all, First: I don't know English very well. Second: I am using Tomcat 5.5.17 and when I run my application I notice that Tomcat creates more than 1 session when an user log in my application. And when this happen I can't recover information about the users and the application's applets can't load correctly. My doubt is if I have to make some configurations in Tomcat. Localy and accessing the server by the ip address plus the port plus the applications's name the application runs normally. The problem just happen when I access my application by a virtual host installed in my network(another server). What could be happening? thanks Jose - Mensagem verificada pelo software de Anti-Virus McAfee. FAMERP - STI - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]