Has anyone tried to do this and gotten it to work? I have tried to set them up accessing the same database on the same server using the same remember-me key but it will not work. Is there something I may be missing? Is this even possible if they are completely separate war files?
Share
The main consideration is the domains and paths under which the applications are accessed and whether the remember-me cookie can be shared among them.
By default the cookie path is set to be the context path of the application, so you cannot share a cookie between two different applications unless you change this. Even then, if the domains do not match, the browser will refuse to send the cookie.
You need to override the
setCookiemethod inAbstractRememberMeServicesto avoid setting a specific path for the cookie. If the domains do not exactly match you will also have to call theCookie.setDomainmethod. You can use something likesetDomain(".foo.com")to share the cookie betweena.foo.comandb.foo.com. See the Javadoc for more details.