Skip to content

Be able to set cookies on the client #13

@menelike

Description

@menelike

Is your feature request related to a problem? Please describe.
If I am not mistaken (and sorry for the noise if I am),

[[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if(error && (self.stoppedTasks == nil || ![self.stoppedTasks containsObject:urlSchemeTask])) {
@try {
NSLog(@"WebviewProxy error: %@", error);
[urlSchemeTask didFailWithError:error];
return;
} @catch (NSException *exception) {
NSLog(@"WebViewProxy send error exception: %@", exception.debugDescription);
}
}
saves the server-set cookie. A cookie set on the client (document.cookie) won't be used in any request. It would be nice to set cookies on the client as well.

Describe the solution you'd like
Ideally, something like window.WebviewProxy.setCookie() with the same behavior as document.cookie should do the job.

Additional context
I am testing this in a Meteor/Cordova context where I had no luck with app-bound-domains. This issue explains the issue in conjunction with Meteor risetechnologies/cookieTest#2 (comment)


Also thanks a lot @NiklasMerz for open sourcing your approach, IMHO this is a slim and neat way to tackle ITP issues! 🚀

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions