I just faced a weird problem with $_SESSION
.
I have built a Real Estate
website for a client but after a while he called me and said that the Back-end
disconnect by itself whenever he does an update, delete or create action on a property.
The weird part is that this problem happens only to him when I try to do it on my computer I don't face this problem.
In my code I'm doing a simple test for all paths of the Back-end
to check if there is a user connected to display the page for him, otherwise the visitor will be redirected to the login page.
Here is my code:
if(!isset($_SESSION['user']))
$this->redirectToRoute($loginRoute);//---this is not symfony function it's a simple function I created to redirect to the selected path
So my conclusion is that the session is being destroyed by itself that's why when he do an update, create or delete action he find himself in the login page !
What can be the source of such problem ?!!