How to create a unique login system in PHP ? Give access to multiple sites for the user, without having to log in to each site. Like Google, with a single login, you use Google and YouTube.
How to create a unique login system in PHP ? Give access to multiple sites for the user, without having to log in to each site. Like Google, with a single login, you use Google and YouTube.
Any session created, by default a cookie is created in the browser named PHPSESSID
, which is the name of the session (in hash) created by your code in the temporary folder of the server.
You can access this cookie by using session_get_cookie_params()
before session_start()
which will show some parameters:
Array
(
[lifetime] => 0
[path] => /
[domain] =>
[secure] =>
[httponly] =>
)
[lifetime] => 0
indicates that when the browser is closed the cookie will disappear and so the session will be closed.
Thinking in this way, in which whenever a session is opened a cookie is created. I do not see why not to use cookies for this case:
So it will only log in to any of the sites.
Of course there is a whole security involved that you will have to accomplish.
I hope I have helped.
Hugs!