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

Cookie Support #74

Closed
channelcat opened this issue Oct 19, 2016 · 3 comments
Closed

Cookie Support #74

channelcat opened this issue Oct 19, 2016 · 3 comments

Comments

@channelcat
Copy link
Contributor

channelcat commented Oct 19, 2016

Cookie support is needed for both requests and responses.

Request:

  • Provide a cookie property with caching to self.parsed_cookies
  • optimally, it should just be a dictionary of cookie keys to cookie values, to be used like:
cookie_value = request.cookies['cookie_name']

Response:

  • Interface could look like:
response.cookies['cookie_name'] = 'cookie_value'
response.cookies.set(name='cookie_name', value='cookie_value', secure=True,\
                     http_only=True, domain='.my-domain.com', path='/my-path', \
                     expires=datetime.now(), max_age=timedelta(days=1))
  • Ideally, this should update the Set-Cookies header of the response when cookies are set.
@blakev
Copy link
Contributor

blakev commented Oct 19, 2016

This is a little harder than I anticipated, is there an external cookie library you'd consider or should it be re-implemented for this project?

You can follow my progress here, master...blakev:feature/cookies

@imbolc
Copy link
Contributor

imbolc commented Oct 22, 2016

Why just don't use aiohttp realization? Do you found some performance problem with this?
get
set

channelcat added a commit that referenced this issue Oct 23, 2016
Adding cookie capabilities for issue #74
@channelcat
Copy link
Contributor Author

Ah, nice. I had no idea there was a cookie parser bundled with Python. I put in basic cookie handling using http.cookies.SimpleCookie. Thanks both of you for working on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants