-
1. Re: Disable cookies on server side in JBoss AS 7.1
jaikiran Sep 24, 2012 9:29 AM (in response to chrkoelle)Moved to JBossWeb forum where you might get some help.
-
2. Re: Disable cookies on server side in JBoss AS 7.1
jfclere Sep 24, 2012 10:48 AM (in response to jaikiran)1 of 1 people found this helpfulIt is a servlet 3.0 spec part. you need in web.xml of the webapp:
<session-config>
<tracking-mode>URL</tracking-mode>
</session-config>
-
3. Re: Disable cookies on server side in JBoss AS 7.1
chrkoelle Sep 25, 2012 5:45 AM (in response to jfclere)Thanks for the answer. This works of course. Unfortunately it's not a real solution for us. In our case we have one web application (.war) that should work in one environment with and in another without cookies. The web.xml is packed in the archive, so a configuration possibility outside the archive would be preferable. Otherwise we have to do some build magic to create two different web archives.
-
4. Re: Disable cookies on server side in JBoss AS 7.1
jaikiran Sep 25, 2012 5:56 AM (in response to chrkoelle)Christian Kölle wrote:
Thanks for the answer. This works of course. Unfortunately it's not a real solution for us. In our case we have one web application (.war) that should work in one environment with and in another without cookies. The web.xml is packed in the archive, so a configuration possibility outside the archive would be preferable. Otherwise we have to do some build magic to create two different web archives.
Are both environments running AS7? If yes, then there's a possible solution. AS 7.1 (I don't exactly remember the version) supports system property replacement in deployment descriptors. So you can have something like this in the web.xml:
<session-config> <tracking-mode>${session.tracking.mode}</tracking-mode> </session-config>
Then you can pass different values for the session.tracking.mode system property (by the way, you can name that to anything) depending on the environment:
Environment 1:
./standalone.sh -Dsession.tracking.mode=URL
Environment 2:
./standalone.sh -Dsession.tracking.mode=COOKIE
-
5. Re: Disable cookies on server side in JBoss AS 7.1
chrkoelle Sep 25, 2012 6:24 AM (in response to jaikiran)Thanks for this really fast answer. That's exactly the solution I need.