Hello,
So in my root directory sessions work fine. On every page I include an initialization page like so:
<?php include "http://localhost/home/core/init.php";?>
On this page I start the session:
session_start();
Now when logged in to my site I can browse every page in the root directory and still be logged in.
I remain logged in while browsing pages like localhost/home/index.php, localhost/home/about.php etc.
Now when I want to go to a profile page I have to go to another (users) directory:
localhost/home/users/profilepage.php
When I get to this page I am not logged in. I'm presented with a log in form (this is displayed if the user is not logged in).
I have tried things like setting cookie params in the php.ini file to no avail. I have scoured the web endlessly
for days trying to solve this. I need to have many folders/directories on my site and I'm going to need to solve
this soon. I haven't progressed in 3 days and it's very frustrating.
I don't know why it's happening as I'm still including the initialization page that starts the session on the page in the new directory.
I'm fairly new to PHP and programming in general.
Thanks you very much any suggestions are apprectiated.