-
1. How to use cookie in JBoss 5.0.0 GA?
wolfgangknauf Mar 31, 2011 10:28 AM (in response to eng.msalah)Hi,
do you create the cookie yourself? If yes: you can set the lifetime using this code:
Cookie cookie = new Cookie ("name", "value");
//Set lifetime: here 60 sec * 60 minutes * 24 hours * 365 days = 1 year
cookie.setMaxAge( 60 * 60 * 24 * 365);
_response.addCookie(cookie);
If the cookie is autocreated by some library, please provide more details.
Hope this helps
Wolfgang
-
2. How to use cookie in JBoss 5.0.0 GA?
eng.msalah Apr 1, 2011 10:17 AM (in response to wolfgangknauf)I am using the previous code to add cookie but when close IE and then open to try any thing base on cookie i found old cookie losted and default values loaded
-
3. How to use cookie in JBoss 5.0.0 GA?
wolfgangknauf Apr 4, 2011 8:46 AM (in response to eng.msalah)Did you try it with a different browser (e.g. Firefox)?
I had never used Cookies in JBoss, but I think I would have heard about it being broken, so I assume it works ;-).
Best regards
Wolfgang
-
4. How to use cookie in JBoss 5.0.0 GA?
eng.msalah Apr 6, 2011 5:21 PM (in response to wolfgangknauf)FF work but IE7 not work, i found this issue in Tomcat server when use version 1 cookie; set cookie path between double quotes and this make IE can not use generated cookies by tomcat
And to solve this issue use version 0 but this version has limitaion in some characters (:=;'"()) usage.
check these links.
http://issues.liferay.com/browse/LEP-5175
http://marc.info/?l=tomcat-dev&m=120611821500777&w=2
http://old.nabble.com/Cookie-handling-issue-%28bug-%29-in-Tomcat-5.5.26-td15565291.html
Best regards
M.Salah
-
5. Re: How to use cookie in JBoss 5.0.0 GA?
john_salokya Jun 30, 2011 1:38 AM (in response to eng.msalah)All the Special charecter like (white space, brackets, parentheses, equals signs, commas, double quotes, slashes, question marks, at signs, colons and semicolons) can store in cookie value if we are adding space
example:
1. In case email id: instead of storing name@url.com if we will store name@url.com<space> then it is going to stored in cookie value
2. instead of storing value like id:2|name:India if we store id:2|name:India<space> then it is going to stored in cookie value
here<space> mean while construting the cookie value using these charecter add/append space to it. and while retrieve the value from cookie remove the space by trim().