• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple JSESSIONID cookies getting created

Sudarshan Chakrabarty
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have an application running on Weblogic 9.2.

The url of my application is something like http://abc.xyz.com/freeR/xxxx.action.

I have a requirement to write the JSESSIONID cookie under the .xyz.com domain.

I created a servlet filter "MyFilter" which creates the JSESSIONID cookie under the ".xyz.com" domain.

This is the mapping in my web.xml

I set the cookie value with

Now, the issue is when I run the above url , I can see two JSESSIONID cookies getting created .

So, for e.g. if session.getId() returns 4WhSMLrfpGBG1xx5TpmPJ2C7msBL5g2wXngkD1pGgQm6tl7Y17RT!-288131970!1288186719727

one cookie gets created under abc.xyz.com with the value 4WhSMLrfpGBG1xx5TpmPJ2C7msBL5g2wXngkD1pGgQm6tl7Y17RT!-288131970
and the other JSESSIONID cookie gets created under .xyz.com with the value 4WhSMLrfpGBG1xx5TpmPJ2C7msBL5g2wXngkD1pGgQm6tl7Y17RT!-288131970!1288186719727

The difference in the value of the cookies is the last part (!1288186719727 in this case)

Is there a way I can restrict the cookie from being created under abc.xyz.com and secondly why are the values different in both the cookies( only the last part after the ! is different)?

Thanks in advance .


  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic