¡@

Home 

2014/10/16 ¤W¤È 08:21:11

android Programming Glossary: paramname.equalsignorecase

How to parse a cookie string

http://stackoverflow.com/questions/5574530/how-to-parse-a-cookie-string

rawCookieParamNameAndValue rawCookieParams i .trim .split String paramName rawCookieParamNameAndValue 0 .trim if paramName.equalsIgnoreCase secure cookie.setSecure true else if rawCookieParamNameAndValue.length 2 throw new Exception Invalid cookie attribute.. Invalid cookie attribute not a flag or missing value. String paramValue rawCookieParamNameAndValue 1 .trim if paramName.equalsIgnoreCase expires Date expiryDate DateFormat.getDateTimeInstance DateFormat.FULL .parse paramValue cookie.setExpiryDate expiryDate.. expiryDate DateFormat.getDateTimeInstance DateFormat.FULL .parse paramValue cookie.setExpiryDate expiryDate else if paramName.equalsIgnoreCase max age long maxAge Long.parseLong paramValue Date expiryDate new Date System.getCurrentTimeMillis maxAge cookie.setExpiryDate..