Q:

How to make login in codeigniter restserver

I'm using Codeigniter rest-server library.
I'm having some doubts about authentication of this library.
//In config file    
$config['rest_valid_logins'] = ['admin' => '1234'];

I want know how to make login with the user of are in  my table in database and keep this logged user in a session.
PS: Sorry about my english and sorry if something is wrong
From Brazil

A:

You can use JWT instead sessions to authenticate users. Besides being quite safe, you will be following the pattern of not saving state in a RESTful API.

