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 Helper #205

Closed
8 tasks
lonnieezell opened this issue Aug 2, 2016 · 7 comments
Closed
8 tasks

Cookie Helper #205

lonnieezell opened this issue Aug 2, 2016 · 7 comments
Labels
new feature PRs for new features
Milestone

Comments

@lonnieezell
Copy link
Member

I can see these being handy at times, though in controllers you can now use $request->getCookie() and $response->setCookie() so this might not be needed, honestly. However, for now we'll keep it in place.

Basically a straight port, setup to use our new features and styles.

Development Checklist:

  • Component(s)
  • ... with PHPdocs
  • Unit testing
  • ... with >80% coverage
  • User guide updated
  • Classmap integration?
  • Securely signed commits
  • Conforms to style guide
@lonnieezell lonnieezell added help wanted More help is needed for the proper resolution of an issue or pull request new feature PRs for new features labels Aug 2, 2016
@lonnieezell lonnieezell added this to the Pre-Alpha 2 milestone Aug 2, 2016
@prezire
Copy link
Contributor

prezire commented Aug 9, 2016

I can work on this as it needs prefixing from Config/App.

@lonnieezell lonnieezell added in progress and removed help wanted More help is needed for the proper resolution of an issue or pull request labels Aug 10, 2016
@prezire
Copy link
Contributor

prezire commented Aug 22, 2016

If I remember correctly, helpers were created mostly for View purposes. Perhaps this is useful on the UI side wherein there's no need to create variables (needed by views) from the controller thus, removing the tedious part. Meanwhile, are we missing Response::getCookie() method? CI3 has the implicit Input::cookie(), however I prefer the explicit Response::getCookie() to compensate for Response::setCookie().

@prezire
Copy link
Contributor

prezire commented Aug 22, 2016

In addition, I wonder if "headers already sent exception" for unit tests has been solved? I'm not thoroughly familiar with any concrete solutions to test cookies with this.

@prezire
Copy link
Contributor

prezire commented Aug 22, 2016

Cancel Response::getCookie(). Perhaps I can find a workaround via IncomingRequest::getCookie().

@lonnieezell
Copy link
Member Author

I wonder if "headers already sent exception" for unit tests has been solved? I'm not thoroughly familiar with any concrete solutions to test cookies with this.

I doubt it. Someone had started refactoring some stuff for us but I don't think we got that far into our additional testing features.

Cancel Response::getCookie(). Perhaps I can find a workaround via IncomingRequest::getCookie()

Correct, cookies are read from the Request and written to the Response, as per HTTP specs.

This shouldn't need anything fancy, though, grab the request or response object from \Config\Services::request() and \Config\Services::response(), and let that handle it.

@prezire
Copy link
Contributor

prezire commented Aug 24, 2016

Nice. Was looking for these two. I'll start focusing on Services class for future implementations. I'll also submit a PR for this helper in a couple of hours.

@lonnieezell
Copy link
Member Author

Completed in #241

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

No branches or pull requests

2 participants