I am developing a client application. Most applications work with WebView . It downloads several pages from a web server.
After user authorization, I receive all cookies and save them locally. Then I will put these webView cookies through CookieManager , CookieSyncManager . After the user goes to a specific page, the server will return the same cookies, but this time will add a new value. From now on, I need to get this part of the cookie and sync it.
Please note that I should not receive a new cookie and replace it with the previous one, but find what is new in the cookie and add it to our current one.
I saw problems and solutions for processing cookies. But what the server returns is not like those standard pair values . This is what a cookie looks like
PHPSESSID=27dd72de72e1643727c4ddb150b2f988; aes_session=a%3A12%3A%7Bs%3A10%3A%22aaaaaaaa%22%3Bs%3A32%3A%22e116b84c302d763a4f759caa5d178455%22%3Bs%3A10%3A%22bbbbbbb%22%3Bs%3A15%3A%22111.111.111.111%22%3Bs%3A10%3A%22user_agent%22%3Bs%3A40%3A%22Apache-HttpClient%2FUNAVAILABLE+%28java+1.4%29%22%3Bs%3A13%3A%22jjjjjjjj%22%3Bi%3A1372138481%3Bs%3A9%3A%22cccccc%22%3Bs%3A0%3A%22%22%3Bs%3A4%3A%22fail%22%3Bs%3A7%3A%22ddddddd%22%3Bs%3A2%3A%22id%22%3Bs%3A2%3A%2231%22%3Bs%3A8%3A%22eeeeee%22%3Bs%3A7%3A%22ffffffff%22%3Bs%3A4%3A%22ggggggg%22%3Bs%3A9%3A%22hhhhhh%22%3Bs%3A7%3A%22%22%3Bs%3A1%3A%221%22%3Bs%3A6%3A%22iiiiii%22%3Bs%3A1%3A
iiiiii , and the following value is added in this example.
The question is, are there any parsers to work with this cookie, or should I think about writing some kind of regEx? Thanks for the help!
source share