0 Replies Latest reply on Feb 10, 2011 6:15 PM by donakalz

    Two apps, one domain

      I have two seam web apps. Each app runs pretty fine. Each app consists of jsf pages, servlets and what not. Thats not the problem. I have pointed my domain name, www.domain.com (i have substituted 'domain' for my actual site name) to app1.war using jboss virtual hosting mechanism. Everything is great. Now app2.war is another application (jsp) which is served through the domain, app2.domain.com (also using virtual hosting native to jboss app server). Now I have an authentication mechanism in app1.war and users' information is stored in a database. I would like to implement sso to automatically log users into app2.war (app2.domain.com). However, I would like to take advantage of a major functionality of cookies. Cookies stored for a domain, eg www.domain.com are also accessible to every request for resources under that domain. for example, www.domain.com/foo.html or www.domain.com/foo/bar.html are able to access the same cookies. With my current setup of both applications, the first app would create cookies under the domain www.domain.com while the second would create cookies under app2.domain.com. This is a problem for me since a cookie written to a client's browser by app1 (www.domain.com) would not be accessible to app2( app2.domain.com). Now I arrive at the question again. Does someone know an elegant way to access app2 as a path of app1. So I would like to access app1 as www.domain.com and app2 as www.domain.com/app2. Obviously I could just integrate all the pages and code from app2 into app1 (thereby having a single app) and have the pages of app2 accessed from a directory (named 'app2' ) under the web root of app1. This approach just seems very dirty to me. However I am unable to solve this problem, I'll have to do it the dirty way.