Modifier and Type | Field and Description |
---|---|
static String |
USER_COOKIE_NAME
The cookie name for the Errai Security cookie.
|
Constructor and Description |
---|
UserCookieEncoder() |
Modifier and Type | Method and Description |
---|---|
static User |
fromCookieValue(String userString)
Decode a persisted
User from a cookie value. |
static String |
toCookieValue(User user)
Encode a cookie value used for persisting a
User . |
static String |
unquoteIfNeeded(String s)
Unquotes a cookie value if it has been quoted and escaped by the Jetty web server.
|
public static final String USER_COOKIE_NAME
public static String toCookieValue(User user)
User
.user
- The user to be persisted.User
that can be decoded by
fromCookieValue(String)
.User
,
USER_COOKIE_NAME
,
fromCookieValue(String)
public static User fromCookieValue(String userString)
User
from a cookie value.userString
- A cookie value that has been persisted using
toCookieValue(User)
.User
object persisted in the given cookie value.User
,
USER_COOKIE_NAME
,
toCookieValue(User)
public static String unquoteIfNeeded(String s)
This method is based on (originally copied from) the org.mortbay.util.QuotedStringTokenizer.unquote method from Jetty 6.1.25.
s
- the cookie value that may or may not be quoted.Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.