Skip to content
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

Add cookie container #1

Closed
abinop opened this issue May 17, 2015 · 3 comments
Closed

Add cookie container #1

abinop opened this issue May 17, 2015 · 3 comments

Comments

@abinop
Copy link

abinop commented May 17, 2015

How can I set cookies in the connection?

@adamhartford
Copy link
Owner

I need to add support for setting HTTP headers on the connection. That's next on the to-do list.

@abinop
Copy link
Author

abinop commented May 18, 2015

thank you @adamhartford

@adamhartford
Copy link
Owner

As of v0.4.0, cookies set in your app's NSHTTPCookieStorage will be sent to SignalR.

Manually setting a cookie:

let cookieProperties = [
    NSHTTPCookieName: "Foo",
    NSHTTPCookieValue: "Bar",
    NSHTTPCookieDomain: "myserver.com",
    NSHTTPCookiePath: "/",
]
let cookie = NSHTTPCookie(properties: cookieProperties)
NSHTTPCookieStorage.sharedHTTPCookieStorage().setCookie(cookie!)

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

No branches or pull requests

2 participants