com.atlassian.seraph.cookie
Interface CookieEncoder

All Known Implementing Classes:
EncryptedCookieEncoder, InsecureCookieEncoder

public interface CookieEncoder

Encodes and decodes the username and password for remember-me cookies


Method Summary
 java.lang.String[] decodePasswordCookie(java.lang.String cookieVal, java.lang.String encoding)
          Decodes a cookie string containing a username and password.
 java.lang.String encodePasswordCookie(java.lang.String username, java.lang.String password, java.lang.String encoding)
          Builds a cookie string containing a username and password, using offsets to customise the encoding.
 

Method Detail

encodePasswordCookie

public java.lang.String encodePasswordCookie(java.lang.String username,
                                             java.lang.String password,
                                             java.lang.String encoding)
Builds a cookie string containing a username and password, using offsets to customise the encoding.

Parameters:
username - The username.
password - The password.
encoding - A String used to customise cookie encoding (only the first 3 characters are used)
Returns:
String encoding the input parameters, an empty string if one of the arguments equals null.

decodePasswordCookie

public java.lang.String[] decodePasswordCookie(java.lang.String cookieVal,
                                               java.lang.String encoding)
Decodes a cookie string containing a username and password.

Parameters:
cookieVal - The cookie value.
encoding - A String used to customise cookie encoding (only the first 3 characters are used) - should be the same string you used to encode the cookie!
Returns:
String[] containing the username at index 0 and the password at index 1, or { null, null } if cookieVal equals null or the empty string.


Copyright © 2008 Atlassian Software Systems Pty Ltd. All Rights Reserved.