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

Bug: Cookie path replaced with system's PATH env variable #4559

Closed
masuraoru opened this issue Apr 12, 2021 · 2 comments · Fixed by #4561
Closed

Bug: Cookie path replaced with system's PATH env variable #4559

masuraoru opened this issue Apr 12, 2021 · 2 comments · Fixed by #4561
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@masuraoru
Copy link

masuraoru commented Apr 12, 2021

Describe the bug
In every request that creates a new cookie, the cookie path is replaced with the system PATH env variable.

CodeIgniter 4 version
develop

Affected module
CodeIgniter\Config\BaseConfig

Steps to reproduce

  • open browser's dev console
  • run request that creates new cookie
  • see path attribute in Set-Cookie of response headers (for me it's path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin)

Expected behavior

  • path attribute must contain value from cookie config class, e.g. '/'

Context

  • OS: Ubuntu 20.04
  • Apache 2.4.41
  • PHP 7.4.3
@masuraoru masuraoru added the bug Verified issues on the current code behavior or pull requests that will fix them label Apr 12, 2021
@masuraoru
Copy link
Author

During debugging I came to the conclusion that the problem lies in CodeIgniter\Config\BaseConfig:147.
Not sure how to fix this correctly. My temporary workaround:
replace

$value = getenv($property);

with

if ($property=='path') {
return null;
}
$value = getenv($property);

@totoprayogo1916
Copy link
Contributor

have same issue

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants