trello-php icon indicating copy to clipboard operation
trello-php copied to clipboard

Undefined global variable $_SESSION

Open Pondake opened this issue 2 years ago • 1 comments

After setting personal auth, it tries to get this key through the session?

file; "...\vendor\\stevenmaguire\\trello-php\\src\\Authorization.php"
message: Undefined global variable $_SESSION

I use Laravel 10 that has it's session management. If I add a middleware to start a session, this still won't work as it doesn't set it properly.

Any other way to still achieve this?

Pondake avatar Jun 22 '23 14:06 Pondake

This package, and specifically the class in question is 8 years old! A lot has changed since then.

I would be happy to review and accept a pull request that smooths this out.

Ideally, the Authorization class is updated with a setSessionHandler(SessionHandlerInterface $sessionHandler) method so you could provide your own session manager that implements the stock PHP interface. Then the class could be updated to use that object and set a default handler upon instantiation.

If that sounds like something you're up for, I am happy to include.

stevenmaguire avatar Jun 22 '23 18:06 stevenmaguire