|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.web.util.CookieUtils
public class CookieUtils
This class handles utility methods for managing HTTP cookies.
Field Summary | |
---|---|
static String |
JSESSIONID
session id cookie name |
Constructor Summary | |
---|---|
CookieUtils()
|
Method Summary | |
---|---|
static String |
getSingleSessionId(javax.servlet.http.Cookie[] cookies)
Gets the session id as a string from the given array of Cookie objects if only one JSESSIONID cookie is
found. |
static boolean |
hasSessionId(javax.servlet.http.Cookie[] cookies)
Returns true if one or more cookies with name of JSESSIONID is found. |
static void |
setSessionCookie(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String sessionId)
Adds a new JSESSIONID cookie to the HTTP response if the given sessionId is not null. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String JSESSIONID
Constructor Detail |
---|
public CookieUtils()
Method Detail |
---|
public static String getSingleSessionId(javax.servlet.http.Cookie[] cookies)
JSESSIONID
cookie is
found. If none or more than one JSESSIONID
cookies are found, returns null.
cookies
- the cookies.
public static boolean hasSessionId(javax.servlet.http.Cookie[] cookies)
JSESSIONID
is found.
cookies
- an array of Cookie objects
public static void setSessionCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String sessionId)
JSESSIONID
cookie to the HTTP response if the given sessionId is not null. No cookie is set
if given sessionId is null.
request
- HTTP requestresponse
- HTTP responsesessionId
- session ID to set as a value of the cookie
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |