Codeigniter 4 Rest API Session based Authentication


While accessing codeigniter api via Angular am not getting session variables which already set during login.

 $routes->add('test', 'Users::test',["filter" => "basicAuth"]);

Also filters were used..

    $data = [
        'status'    => 401,
        'success'   => false,
        'message'   => session()->get('isLoggedIn'),
    return Services::response()

if i use browser it’s working as expected,
but via angular it’s not working, if i print Session()->get() not getting any results.

Source: Angular Questions


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us