File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes request.getCookies(); is not returning all the cookies Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "request.getCookies(); is not returning all the cookies" Watch "request.getCookies(); is not returning all the cookies" New topic
Author

request.getCookies(); is not returning all the cookies

Fawad Ali
Ranch Hand

Joined: Dec 28, 2009
Posts: 108
Hi All,
I have a strange problem. I try to get all the cookies by the following code


But its returning only one cookie and that is of JSessionId. I have confirmed that the cookie exists on the client side but somehow the function is not getting it. BTW at first the code worked fine for me but then later on it stopped working. Any ideas on this.

Thanks in advance.


Regards, Fawad Ali.
Software Engineer, Stafona Inc. - My Blog
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56192
    
  13

Are the cookies for the same domain within which the servlet is executing?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

Sometimes browsers have intelligence to block cookies, as it cannot distinguish between safe and unsafe ones. See if your browser has the option to turn ON to accept cookies.


S.D. MADHAN
Not many get the right opportunity !
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: request.getCookies(); is not returning all the cookies
 
Similar Threads
Not able to set cookies
Cookie
Cookies
response.addCookie is not working
getCookie(FacesContext context, String name) function is not woring in tomcat 6.0.