Skip to content

Initial implementation of HTTPCookieStorage #672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

pushkarnk
Copy link
Member

@pushkarnk pushkarnk commented Oct 6, 2016

I've created this pull request for review and comments. There are two important considerations here, around cookie persistence:

  1. How do you store the cookies?

Writing an NSDictionary to a file using NSDictionary(writeToFile:atomically:)

  1. Where do you store them?

XDG_CONFIG_HOME. See #889

TODOs:

  • setCookies with non-nil mainDocumentURL
  • Implementing sharedCookieStorage(forGroupContainerIdentifier:)
    Implementing sortedCookies(using sortOrder: [NSSortDescriptor])
    NSSortDescriptor is not implemented (is it supported on Linux?)

properties["Domain"] = _domain
return properties
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is work in progress. Other properties need to be added.

@pushkarnk
Copy link
Member Author

added implementations to a few more methods, tests pending

@pushkarnk pushkarnk force-pushed the cookie-storage branch 2 times, most recently from f187740 to 783820a Compare November 7, 2016 19:06
@pushkarnk
Copy link
Member Author

I'm working on updating this one. And also waiting on: #889

@pushkarnk pushkarnk force-pushed the cookie-storage branch 2 times, most recently from 3a7234b to 8c9b7a7 Compare March 13, 2017 10:37
@pushkarnk
Copy link
Member Author

pushkarnk commented Mar 13, 2017

Rebased and updated. This is dependent on the merger of #889


private func createCookie(_ properties: [String: Any]) -> HTTPCookie? {
var cookieProperties: [HTTPCookiePropertyKey: Any] = [:]
for key in properties.keys {
Copy link
Contributor

@naithar naithar Mar 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't the use of for (key, value) in properties be more appropriate here as dictionary value is used anyway?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @naithar I've updated the patch.

@pushkarnk
Copy link
Member Author

The commit for this PR has now been picked up by #889.

@pushkarnk
Copy link
Member Author

#889 is merged. I am closing this.

@pushkarnk pushkarnk closed this Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants