This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
 
Do you pee on your compost? Does this tiny ad?
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!