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.
72 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,515
  • 13
  • 48
  • 94
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
  • 1,860
  • 2
  • 13
  • 38
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
  • 241
  • 3
  • 20
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
  • 543
  • 1
  • 6
  • 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
  • 39
  • 1
  • 8
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,851
  • 8
  • 36
  • 52
0
votes
0 answers

How to Add Cookie in SwiftUI WebView and use self within Struct's Closure?

I'm trying to creating a functionality for adding a cookie within my custom SwiftUI WKWebview but I couldn't proceed because I'm encountering error that reads "Escaping closure captures mutating 'self' parameter". My assumption is that it's because…
0
votes
0 answers

Session cookie being deleted from HTTPCookieStorage seconds after setting it

To keep this short, here is the scenario. I'm opening a web view, allowing a user to log in, then scraping the session cookie after logging in and saving it in the cookie storage. HTTPCookieStorage.shared.setCookie(cookie) But then, 2 seconds…
0
votes
0 answers

What does NSHTTPCookie sessionOnly flag means in WKWebView context

What does NSHTTPCookie sessionOnly flag means in WKWebView context? The cookies do not seem to survive return from a 3rd party site to a site that we control.
Anton Tropashko
  • 4,300
  • 3
  • 31
  • 53
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
  • 151
  • 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,450
  • 9
  • 42
  • 99
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
  • 2,545
  • 1
  • 26
  • 40
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…
Dalvik
  • 4,119
  • 5
  • 28
  • 83