Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何解析原始 cookie 字符串。
它必须返回 javax.servlet.http.Cookie 对象。
像这样的原始cookie:
Set-Cookie: BAIDUID=66AA214F9A534411A339CE5E60D36E28:FG=1; expires=Sun, 05-Aug-42 06:41:06 GMT; path=/; domain=.baidu.com
我不明白您面临的困难是什么-您尝试了什么?
String[] pairs = String.split(";")
pair.subString(0, pair.indexOf(':') + 1)
pair.subString(pair.indexOf(':') + 1, pair.length - (pair.indexOf(':') + 1))
pair.indexOf(':')