tuupola / slim-basic-auth

PSR-7 and PSR-15 HTTP Basic Authentication Middleware
MIT License
440 stars 66 forks source link

Before & After Callbacks Never Triggered #98

Closed Powers-RC closed 4 years ago

Powers-RC commented 4 years ago

What did you do to resolve this? I am having the same issue where the after call back is not being triggered.

"after" => function (Response $response, $arguments) use(&$container):  Response {
            var_dump("You entered this callback");
            $session = $container->get('Session');

            if (session_status() === PHP_SESSION_NONE){
                //12  hours
                $session->start([
                    'cookie_lifetime' => 43200,
                    'cookie_httponly' => true,
                    'cookie_secure' => true,
                    'cookie_samesite' => true,
                    'cookie_domain' => 'thenetnotebook.io'
                ]);
            }

            return $response;
        }

Originally posted by @Powers-RC in https://github.com/tuupola/slim-basic-auth/issues/82#issuecomment-680015175