spiral / app

Spiral Framework Skeleton HTTP Application: Queue, Console, Cycle ORM
https://spiral.dev/
MIT License
191 stars 20 forks source link

Not redirecting as required #23

Closed sujit-baniya closed 4 years ago

sujit-baniya commented 4 years ago

Because of issue I raised here: https://github.com/spiral/app/issues/21

I tried to implement Session.

Code: HomeController@index

public function index()
    {
        $authSession = $this->session->getSection('auth');
        if(empty($authSession->has('token'))) {
            dump(1);
            $this->response->redirect($this->router->getRoute('login')->uri());
        }
    }

Here the $authSession->has('token') is empty but not redirecting to login.

But redirecting is working from LoginController: https://storyxpress.co/video/k8y3f79by43739kwh

Why is it happening? Any solution for this?