Skip to content
Advertisement

Tag: cookies

SameSite cookie in Java application

Do you know any Java cookie implementation which allows to set a custom flag for cookie, like SameSite=strict? It seems that javax.servlet.http.Cookie has a strictly limited set of flags which can be added. Answer I am not a JEE expert, but I think that because that cookie property is a somewhat new invention, you cannot expect it to be present

Get cookie value in java

I’ve initialized cooke like this in my JSP, So, all the cookies created will have the same name, but different value for different user access time. At the ending of java servlet I want to deactivate/kill the cookie that has been passed at the beginning of java servlet and say if they are 5 users using the system in parallel

In Java servlet, cookie.getMaxAge() always returns -1

If I set a cookie with a setMaxAge() well into the future, when I read the cookie back into memory in a subsequent request, the getMaxAge() gives me back a -1. I have checked the actual cookie via Chrome’s settings, and inspector, and I can verify that the expiration date is indeed set 60 days in the future. Why does

Write and Read Cookies in different Applications

I have two applications running in Jboss, can I write a cookie in a application and read in another? For example, if I have two Servlets: – WriterCookieServlet on localhost:8080/Application1 – ReaderCookieServlet on localhost:8080/Application2 WriterCookieServlet: Then on ReaderCookieServlet I want read this cookie. Answer I think @galuano1 is right: this should indeed be possible. Make sure the path is correct,

Advertisement