Skip to content

SessionManager methods missing #13

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

Open
krazzer opened this issue Feb 17, 2021 · 0 comments
Open

SessionManager methods missing #13

krazzer opened this issue Feb 17, 2021 · 0 comments

Comments

@krazzer
Copy link

krazzer commented Feb 17, 2021

When my tests tried to run a test that involved a session destroy, I got an error. Because MemorySession.php doesn't actually start the session using session_start, session_destroy doesn't work either.

Also, MemorySession.php's get and set methods aren't actually used, because the get and set are called from SessionManager.php.

I fixed this by adding methods to SessionManager.php:

class SessionManager extends Manager
{
    //...

    public function destroy(): void
    {
        $this->getAdapter()->destroy($this->getId());
    }

    public function get(string $key, $defaultValue = null, bool $remove = false)
    {
        return $this->getAdapter()->get($key, $defaultValue, $remove);
    }

    public function set(string $key, $value): void
    {
        $this->getAdapter()->set($key, $value);
    }
}

Please let me know if this is correct, or if I'm missing something.

@krazzer krazzer changed the title SessionManager functions missing SessionManager methods missing Feb 17, 2021
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

No branches or pull requests

1 participant