K
Kinde5mo ago
sieben

Missing methods on PHP SDK storage

Hi, I'm running into issues with the PHP SDK setting cookies for specific page paths instead of the root path. While trying to understand why that's happening I am attempting to set the cookie path using the setCookiePath() method that is described in the PHP SDK documentation. It doesn't seem to exist for me, do I have the wrong SDK installed somehow, or is the documentation not correct? code: $storage = Storage::getInstance() $storage->setCookiePath('/'); <- returns a method not found Thanks!
3 Replies
onderay
onderay5mo ago
If you are encountering a "method not found" error, it could be due to a few reasons: SDK Version: Ensure that you have the latest version of the Kinde PHP SDK installed. You can update the SDK using Composer with the following command:
composer update kinde-oss/kinde-auth-php
composer update kinde-oss/kinde-auth-php
Namespace and Class: Make sure you are correctly using the namespace and class. Your code should look something like this:
use Kinde\KindeSDK\Sdk\Storage\Storage;

$storage = Storage::getInstance();
$storage->setCookiePath('/');
use Kinde\KindeSDK\Sdk\Storage\Storage;

$storage = Storage::getInstance();
$storage->setCookiePath('/');

Installation Verification: Verify that the SDK is correctly installed and autoloaded. Check your composer.json file to ensure it includes the Kinde SDK:
"require": {
"kinde-oss/kinde-auth-php": "*"
}

"require": {
"kinde-oss/kinde-auth-php": "*"
}

If you have verified all the above and the issue persists, let me know
sieben
siebenOP5mo ago
You're a rock star! My version was out of date! I tracked the weird path issue down to when the SDK is using the refresh token. I'm hoping that now that I can set that path it will stick to using '/' as the path instead of whatever page triggered the refresh. Thanks!
onderay
onderay5mo ago
Awesome to hear that you were able to solve the issue you were seeing! Feel free to reach out if you need help with anything else.
Want results from more Discord servers?
Add your server