• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cookie set in FIlter not accessible in FacesContext and vice-versa  RSS feed

 
pete sa
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hullo!

sorry if this was already discussed, or if it is really-really stupid, but am i the only one seeing the following:

1. setup FIlter



2. inside F add Cookies



3. add Cookies in FacesContext anywhere:



4. run the app, in your browser prefs confirm that all the cookies are set

5. read all the cookies in Filter and anywhere in FacesContext and you will *NOT* see cookies created in Filter in faces, and vice-versa.

can someone explain that?
no matter what i set in the cookies, and no matter what one does it is virually impossible to access cookies created in Filter from faces and the other way around/
is this supposed to be so?
i am seeing this with jboss 7.1.1, java 1.7.0_05.
am i crazy? because it really feels like it (which is nice)

cheers,
pg

P.S.
btw hello everyone, this would be my first post, you are probably gonna hate me ;-)

 
pete sa
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I knew it was a stupid question;-)
the answer is: keep in mind that cookies that you can get from anywhere in jsf are filtered according to path, that is: when you call setPath("/myapp"); where "/myapp" is you root url part you will see those cookies everywhere. now by default cookies that do not have the path setup explicitly are given path of the local resource, that is the place they where created from. you will not see those globally..

cheers,
pg
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!