I'm making a mobile application with ionic
and I need to login to external database users, I need to know how I can login through php and create a session with id
of user ?
I'm making a mobile application with ionic
and I need to login to external database users, I need to know how I can login through php and create a session with id
of user ?
Make Token face, I've tried with session, cookies, but token is the most recommended, keeping the status logged in the app, if that's what tabm you want;
Use this link with support: Autonic IONIC / TOKEN / AngularJS
As @Vagner said token is the most recommended. But if you want an example with session maybe this might help:
//Atribui o objeto usuário a referencia usuarioLogado no sessionStorage
sessionStorage.setItem('usuarioLogado', usuario);
Then if you want to recover this user you can do:
/**Pega o objeto armazenado no sessionStorage,
observe que a referencia é a mesma('usuarioLogado')*/
$scope.usuarioLogado = sessionStorage.getItem('usuarioLogado');