A servlet reading cookie??

Case: write a cookie using for example with javascript. Now normally if you have an array of id’s you would just write them plain and simple in the cookie using an array to string respresentation. This is all good…. but if the array to string method is using a comma to seperate the elements there is a problem if you want to use the getCookies method in de javax.servlet.http.HttpServletRequest class of java. It somehow thinks it needs to read every comma seperated element into a different cookie, so what you get is a boogus result. So instead of using comma seperated elements, try using dots or some other sign ;)..

Leave a Reply

Your email address will not be published. Required fields are marked *