@Override
    protected byte[] getRememberedSerializedIdentity(SubjectContext subjectContext) {
        // no need to check for HTTP-aware context - jawn is always in a web environment
        if (! (subjectContext instanceof ContextSource)) {
//            if (log.isDebugEnabled()) {
//                String msg = "SubjectContext argument is not an HTTP-aware instance.  This is required to obtain a " +
//                        "servlet request and response in order to retrieve the rememberMe cookie. Returning " +
//                        "immediately and ignoring rememberMe operation.";
//                log.debug(msg);
//            }
            return null;
        }
            
        Context context = ((ContextSource) subjectContext).getContext();
        
        if (context == null || isIdentityRemoved(context))
            return null;
        
        String base64 = readCookieValue(context);
        // Browsers do not always remove cookies immediately (SHIRO-183)
        // ignore cookies that are scheduled for removal
        // TODO not yet implemented
        //if (Cookie.DELETED_COOKIE_VALUE.equals(base64)) return null;
        
        if (base64 != null) {
            base64 = ensurePadding(base64);
//            if (log.isTraceEnabled()) {
//                log.trace("Acquired Base64 encoded identity [" + base64 + "]");
//            }
            byte[] decoded = Base64.decode(base64);
//            if (log.isTraceEnabled()) {
//                log.trace("Base64 decoded byte array length: " + (decoded != null ? decoded.length : 0) + " bytes.");
//            }
            return decoded;
        } else {
            //no cookie set - new site visitor?
            return null;
        }
    }
@ Override protected byte [ ] getRememberedSerializedIdentity ( SubjectContext subjectContext ) { if ( ! ( subjectContext instanceof ContextSource ) ) { return null ; } Context context = ( ( ContextSource ) subjectContext ) . getContext ( ) ; if ( context == null || isIdentityRemoved ( context ) ) return null ; String base64 = readCookieValue ( context ) ; if ( base64 != null ) { base64 = ensurePadding ( base64 ) ; byte [ ] decoded = Base64 . decode ( base64 ) ; return decoded ; } else { return null ; } }
Returns a previously serialized identity byte array or {@code null} if the byte array could not be acquired.
This implementation retrieves an HTTP cookie, Base64-decodes the cookie value, and returns the resulting byte
array.
<p>
The {@code SubjectContext} instance is expected to be a {@link WebSubjectContext} instance with an HTTP
Request/Response pair so an HTTP cookie can be retrieved from the incoming request.  If it is not a
{@code WebSubjectContext} or that {@code WebSubjectContext} does not have an HTTP Request/Response pair, this
implementation returns {@code null}.

@param subjectContext the contextual data, usually provided by a {@link Subject.Builder} implementation, that
is being used to construct a {@link Subject} instance.  To be used to assist with data
lookup.
@return a previously serialized identity byte array or {@code null} if the byte array could not be acquired.