-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Joshua,
On 1/16/15 1:36 AM, Joshua Wang wrote: > But i see sessionCookiePath, sessionCookieName and > sessionCookieDomain configures, what is those used for? Those are used for customizing the details that Tomcat will use when creating a JSESSIONID cookie to send to the client. If you set the sessionCookiePath to "/" instead of "/context" then your JSESSIONID cookie will be sent to any URL on that same host. If you have multiple web applications there that all expect to use a "JSESSIONID" cookie, you'll confuse all of them simultaneously. > And apache says they just don't recommend to add context into > server.xml, besides, xml files can be putted into > conf\Catalina\localhost Correct: you should use XML files in conf/Catalina/localhost because they can be re-loaded without restarting the whole container. - -chris > On Fri, Jan 16, 2015 at 11:24 AM, Christopher Schultz < > ch...@christopherschultz.net> wrote: > > Joshua, > > On 1/15/15 9:00 PM, Joshua Wang wrote: >>>> I'm using tomcat 6, and i have an application deployed into >>>> webapps and re-named ROOT, so users can visit using >>>> http://ip:8080/. But i need to configure that when users >>>> input http://ip:8080/portal.do and http://ip:8080/csmis also >>>> can visit the same site. So i added <Context> into server.xml >>>> like below: <Context path="/portal.do" >>>> docBase="ROOT"></Context> <Context path="/csmis" >>>> docBase="ROOT"></Context> > > You should not configure web applications in server.xml. Instead, > deploy them properly: > > http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Defining_a_context > > >>>> And it does work, but there's also a problem. When user >>>> input http://ip:8080/portal.do visit the site and login, the >>>> Root path can not get the session. In other words, he was >>>> asked to re-login when he open some page from portal.do such >>>> as http://ip:8080/a.jsp. Is there anything i can solve this? > > No. Even with single-sign-on, all web applications have separate > HttpSessions. If you want to share state between them, you'll need > to implement something yourself. > > Suggestions: RDBMS, memcached, etc. > > -chris >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> >> > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJUuTUMAAoJEBzwKT+lPKRYR8oQALqGg+LyEi7mdaO+TaGfXtME DJXXj7x7fGFjCKkm+Ye70ioYOsBYTTTMulZ67YdSXGrb5lDHXbxWAQJwTAaYLzKY 3uKFuH/oNxinVwWZ8KPsth78Xy+abZJ2SAFrR9eNvyi+Qyzsy57KZ/NxsHa2OTfi iLtXmy2ULbWtdaKPQMtfwQ7rdK7iztoHtitDX6K6sNu01m/r5d0rIH4gsDg5uN6n DyWzlmBHHFTQdK/qb1Knpqn2sTDlJwQ+rN/P2dHa/MpmG18GoXCkBLZAwWL1uH16 POkzPJPHr8ZJeBpbJvBEt2lZJb+JAggXDSAu4yTTKM2NdDN2ziO3OoRmrXoPL+wa 5YIja1VFC3Qtw88fGagprGh1Negc8mrMOD2ziGNAEvpM/yrencmaISyLPQzhmFsN +nYQ9d9nhElJ9YWoGDlIVVfJTZCzRQOPCltTfTQsFSam/EkY4wNWNeXpEZbWHWdK nADY0n0Hevzg/Nwp7vqPVnpalSQoE4ToKrbU7XRGPiVS3XAJdMH1DmUg6BuaXs5x CBBQAT10fiuCWmpu5Hc4UQ9f1HcLSOer3XlLVO4FvqMYQBgVm5ORlVaeSSiyDps+ Fg406FqjvEzdFm5rYHujivwMXLB42ChuKDJGDWGDzFZP+8oBVtsicNw7ejFP3bxT hwCWaA/idLSds6brxDKJ =2mzB -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org