如何在Cookie数组中提取特定值?

时间:2015-08-20 15:23:14

标签: objective-c cookies

我有一系列的cookie,我必须遍历并检索cookie名称“token”的特定值。当我遍历数组时,我怎么想发现cookie的值是特定的cookie名称?

我的Cookie看起来像 -

("<NSHTTPCookie version:0 name:\"_#name\" value:\"value of this cookie\" expiresDate:2018-05-16 15:30:55 +0000 created:2015-08-20 15:30:55 +0000 (4.61777e+08) sessionOnly:FALSE domain:\"X.X.X.X\" path:\"/\" isSecure:FALSE>",
"<NSHTTPCookie version:0 name:\"_#name\" value:\"value of this cookie\" expiresDate:2018-05-16 15:30:55 +0000 created:2015-08-20 15:30:55 +0000 (4.61777e+08) sessionOnly:FALSE domain:\"X.X.X.X\" path:\"/\" isSecure:FALSE>",
"<NSHTTPCookie version:0 name:\"name\" value:\"value\" expiresDate:2015-08-20 15:40:38 +0000 created:2015-08-20 15:30:38 +0000 (4.61777e+08) sessionOnly:FALSE domain:\"X.X.X.X\" path:\"/\" isSecure:FALSE>",
"<NSHTTPCookie version:0 name:\"token\" value:\"value of the cookie\" expiresDate:(null) created:2015-08-20 15:30:33 +0000 (4.61777e+08) sessionOnly:TRUE domain:\"X.X.X.X\" path:\"/\" isSecure:TRUE>")

我想提取“令牌”的值。

0 个答案:

没有答案