Skip to content

setcookie() is passed a null instead of 0/[] during OAuth Callback. #291

@da-mask

Description

@da-mask

Issue summary

Write a short description of the issue here ↓
When using the package for OAuth of an offline/not embedded app, the function OAUTH::callback() attempts to use setcookie() with a null value for expires: parameter.

Expected behavior

What do you think should happen?
Either a 0 or empty array [] should be passed in instead. We could either make sure expiration does not fallback to being null, or change the constructor of OAuthCookie to set its own value to 0 if null is passed in.

Actual behavior

What actually happens?

setcookie(): Argument #3 ($expires_or_options) must be of type array|int, null given

Steps to reproduce the problem

  1. OAuth::begin( shop: $this->shop->url, redirectPath: $this->redirectUri, isOnline: false, );
  2. $session = OAuth::callback( cookies: $cookies, query: $get ); $accessToken = $session->getAccessToken();

Checklist

  • I have described this issue in a way that is actionable (if possible)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions