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 error #2166

Merged
merged 1 commit into from Aug 28, 2019
Merged

Cookie error #2166

merged 1 commit into from Aug 28, 2019

Conversation

pjsde
Copy link
Contributor

@pjsde pjsde commented Aug 28, 2019

"setcookie() defines a cookie to be sent along with the rest of the HTTP headers. Like other headers, cookies must be sent before any output from your script (this is a protocol restriction). This requires that you place calls to this function prior to any output."

So the call to $this->sendCookies(); must be prior of the call to $this->sendBody(); otherwise the cookies send are not created.

Each pull request should address a single issue, and have a meaningful title.

Description
Explain what you have changed, and why.

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

---------Remove from here down in your description----------

Notes

  • Pull requests must be in English
  • If the PR solves an issue, reference it with a suitable verb and the issue number
    (e.g. fixes 12345
  • Unsolicited PRs will be considered, but there is no guarantee of acceptance
  • Pull requests should be from a feature branch in the contributor's fork of the repository
    to the develop branch of the project repository

"setcookie() defines a cookie to be sent along with the rest of the HTTP headers. Like other headers, cookies must be sent before any output from your script (this is a protocol restriction). This requires that you place calls to this function prior to any output." 

So the call to $this->sendCookies(); must be prior of the call to $this->sendBody(); otherwise the cookies send are not created.
@lonnieezell lonnieezell merged commit 30e6994 into codeigniter4:develop Aug 28, 2019
@pjsde pjsde deleted the pjsde-patch-1 branch August 30, 2019 15:20
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.

None yet

2 participants