If anyone can help me, it will be of great help to me!
I'm starting in PHP, I made an application that worked fine while it was running on my computer, but when I put it into production on Hostgator, after some time (20 to 30 minutes) it seems that it loses the session, causing a problem in some functions that I run by javascript.
When I refresh the page it goes back to the login page (index.php) with error 2 and I need to login again.
Can anyone tell me how I should handle this error? I need not to lose the session so fast and when I do, be able to identify it before executing the functions in Javascript to redirect to the login page, but when I use console.log() before executing the function, appears as if it has not lost the session. So I don't know how to deal with it.