protected void addToCookieMap(Map<String,Map.Entry<String,Date>> map, String cookieString) {
        if(cookieString != null) {
            String session = null;
            String expires = null;
            for(String cookie : cookieString.split(";")) {
                if(cookie.startsWith(SESSION_PREFIX)) session = cookie;
                if(cookie.startsWith(EXPIRES)) expires = cookie;
            }
            if(session != null) {
                String[] sessionSplit = session.split("=");
                if(sessionSplit.length == 2) {
                    Date expiryDate = null;
                    if(expires != null) {
                        String[] expiresSplit = expires.split("=");
                        if(expiresSplit.length == 2) {
                            try {
                                expiryDate = new SimpleDateFormat("EEE, dd-MMM-yyyy hh:mm:ss z").parse(expiresSplit[1]);
                            } catch (ParseException e) {
                                //do nothing
                            }
                        }
                    }
                    map.put(sessionSplit[0], new Pair<String, Date>(sessionSplit[1], expiryDate));
                }
            }
        }
    }