Ionic login with php

Hi everyone, i’m new with ionic 3 and i don’t have any idea how to make a session in php and take it for all the pages of the app. Someone who can help me? (I’m sorry if i did errors writing this topic but i’m not english :frowning: )

Tokens are better than sessions. I would recommend using JWT.

thanks, do you have docs for me please?

Was the link insufficient?

link click badges is 1 (That me click)

sorry i didn’t see the link :smile: i was sleeping ahahah

While tokens are indeed much better than having to deal with sessions, there are times when you can’t change the PHP server. If you must deal with PHP sessions, you need to ensure you use withCredentials:true with your HTTP POST/GET requests. When you enable withCredentials, it handles the session cookies correctly . Note that if the session cookie is marked HTTP only (which means Javascript can’t access it), you won’t be able to access the Set-Cookie headers, but it will work thanks to withCredentials

2 Likes

thanks i don’t need anymore help for this problem, could someone mark as solved?