If anyone logged into Google, Facebook, Amazon, or Stack Overflow the login credentials of that person will alive till log out. I want to ask that how can I keep the login credentials of my user alive into his/her computer till log out using PHP or Javascript?
It is possible using PHP or Javascript if not so what can I do or what technology should I use.
Should I use
Cookiefunction and set expiration time till when my domain gets expired usingmktimefunction.
Edited
Please mention source code of your answer.