0

I am having an array of cookies, in which I have to traverse through and retrieve only particular value of a cookie name "token". when I traverse the array, how am I suppose to find out that the value of the cookie is of that particular cookie name?

My Cookie look like -

("<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>")

I want to extract the value of "token".

rebello95
  • 8,486
  • 5
  • 44
  • 65
nOOb iOS
  • 1,384
  • 2
  • 19
  • 37

0 Answers0