Questions tagged [nshttpcookie]

An NSHTTPCookie object represents an HTTP cookie. It’s an immutable object initialized from a dictionary containing the cookie attributes.

Two versions of cookies are supported:

  • Version 0: This version refers to “traditional” or “old-style” cookies, the original cookie format defined by Netscape. The majority of cookies encountered are in this format.
  • Version 1: This version refers to cookies as defined in RFC 2965, HTTP State Management Mechanism.
69 questions
1
vote
1 answer

Find if cookie has a value for variable

In a previous answer I found on stackoverflow (can't find now) someone suggested using NSRange rangeOfString to see if a particular variable had data in it from a cookie: NSRange range = [[[NSHTTPCookie…
Rudiger
  • 6,749
  • 13
  • 51
  • 102
1
vote
3 answers

NSHTTPCookieStorage for same URL but different users

May be this is a dumb question, but I want to store cookies for same url but different for usernames. How can this be achieved using NSHTTPCookieStorage ? This is how I store cookies from response. NSHTTPURLResponse *httpResponse =…
1
vote
1 answer

NSHTTPCookie nil

here is my code let cookieProperties = [ NSHTTPCookieOriginURL: Constants.baseUrl, NSHTTPCookiePath: "/", NSHTTPCookieName: "device_id", NSHTTPCookieValue: Constants.deviceId ] let cookiePropertiesVersion…
MrDank
  • 2,020
  • 2
  • 17
  • 39
1
vote
1 answer

NSHTTPCookieStorage Array - Parsing out the Value

I have data inside an array (NSHTTPCookieStorage)... NSARRAY *httpCookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:aHttpUrl]; I know for a fact that there are 3 cookies being stored (as I can see them in an NSLog). I don't…
daemon
  • 251
  • 3
  • 21
1
vote
0 answers

Gat OAuth Token From UIWebView Cache Swift

I am presenting a UIWebView in my App, I need to get the OAuth Token that stored on the device Cache after client login but i don't know how. i try so search the cookie, but didn't get the result. for cookie in…
Bar
  • 603
  • 1
  • 7
  • 19
1
vote
1 answer

C# setting cookie using HttpWebRequest

I'm using a test automation platform called Ranorex. The code is C#. I would like to set a cookie to the server using HttpWebRequest before I open a browser to begin the test. Below is the code. Everything executes with no problem. When I view the…
macgowan
  • 71
  • 2
  • 10
0
votes
2 answers

NSURLConnection and NSHTTPCookie

Scenario: Authenticating a user. Grab the cookie, set the cookie for other requests. Fine. What I can't immediately figure out is how to handle when the authentication fails without push my next view onto the screen. if my response is…
user558957
0
votes
1 answer

not deleting cookie (iphone)

NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; NSArray *cookies = [storage cookiesForURL:[NSURL URLWithString:@"http://www.facebook.com/"]]; NSLog(@"old cookies!: %@",cookies); …
James
  • 2,951
  • 8
  • 41
  • 55
0
votes
1 answer

Will cookie get automatically removed post expiry datetime in NSHTTPCookieStorage

I have a cookie stored up manually NSHTTPCookieStorage and whenever I want to read the cookie value I iterate all the cookies from Cookiestorage and find my cookie and read it. NSHTTPCookieStorage *cookieJar = [NSHTTPCookieStorage…
Dan Ram
  • 171
  • 1
  • 14
0
votes
1 answer

Check Validity of Session Cookie

I am storing a session cookie for future API calls after a user successfully logs in. When a user dismisses the account view without signing out, they should be able to go back to their account without going to the sign in view. They should only see…
raginggoat
  • 3,570
  • 10
  • 48
  • 108
0
votes
2 answers

Share WKWebView Cookies With UIWebView

I'm trying to share WKWebView Cookies with UIWebView for getting all cookies. I know its very simple to get all cookies from UIWebView as compare WKWebView. I create two WebView's (WKWebView, UIWebView) in Tabbed Application Template. Below method…
ZAFAR007
  • 3,049
  • 1
  • 34
  • 45
0
votes
0 answers

Issue while sending cookie to URL with UIWebView

I have to open a URL in UIWebview with a cookie. I have to send a cookie to UIWebView. Only if the cookie value will correct then webview will load. Here is my setup: In my appDelegate's method - (void)applicationDidBecomeActive:(UIApplication…
Rahul
  • 5,594
  • 7
  • 38
  • 92
0
votes
1 answer

WebView iOS don't save sessions or cookies

I have a UIWebView in my app that accesses a particular page login, if I enter using the existing webview in my application it appears that the session or cookie are unsaved (and I can't go ahead). But if I try the same thing using the browser…
Lacrifilm
  • 253
  • 5
  • 15
0
votes
2 answers

NSHTTPCookie: expiresDate is always null

I'm creating a cookie using NSHTTPCookie. But when I create the expiration date is getting converted to creation date. Here is my code: NSMutableDictionary *cProperties = [NSMutableDictionary dictionary]; [cProperties setObject:@"31 May 2016…
user2924482
  • 8,380
  • 23
  • 89
  • 173
0
votes
1 answer

Pass cookie to UIWebView - iOS

I have an iOS application which allows the user to use Apple's built in Accounts/Social frameworks to login via Facebook. One question I have is, is there a way to pass user auth cookie from ACAccountStore to a UIWebView? This will mean that, if a…