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

AD-231 Add secure and http_only parameters support for cookies #139

Merged
merged 7 commits into from
May 27, 2022

Conversation

destebang
Copy link
Contributor

  • Introduce new parameters to allow secure and http_only parameters usage.
  • Defaulted both to false $secure = false, $http_only = false so current behaviour is preserved.

{

$domain ?: self::_initDomain();

if ( 0 == $days )
{
$result = setcookie( $name, $value, 0, self::$path, self::$domain );
$result = setcookie( $name, $value, 0, self::$path, self::$domain, $secure, $http_only );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you have to try to add a unit test for this method. Touch me if you want any help ;-D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I was on it, though it was a bit tricky because of class design. Finally I made tests working by adding some seams here and there. Please, take a look again! 😃

@destebang destebang force-pushed the AD-231 branch 2 times, most recently from 5346814 to c6aa534 Compare May 9, 2022 09:41
Copy link
Contributor

@kpicaza kpicaza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!!!

@kpicaza kpicaza merged commit 60855f1 into sifophp:master May 27, 2022
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.

3 participants