How do I set unlimited time to a cookie for a session? I have tried the following below but I still get undefined index notices on my sessions after a day:
s
You should not set cookies to unlimited time. If you need to store something for a longer period, use localStorage. They don't expire. They're not really cookies but it's also a way of setting information in the browser. You just have to use JavaScript with this.
As for PHP, what you can do is you can rely on databases that will store your information permanently. You can set things in local storage that you can use to load session information. But my suggestion is just use localStorage.