I have website that I am testing locally on Xammp. So the homepage of my website is localhost/root/index.php
I have a user login and registration system implemented and it works fine. If a user is logged in they can click
an account link and visit their profile and if a user isn't logged in a login form is displayed. While logged in,
I can successfully browse any of the pages in my root directory and the session will not get lost.
However, if I then try to visit my profile page (Which is in a different folder) the session is lost and the login
form is presented on the profile page. The URL for the profile page would be something like this:
localhost/root/user/profilepage.php
As you can see, to get to the profile page you must leave the root directory and go to the "user" directory.
Once you leave the root directory, however, the session is lost.
I'm 100% sure, that every page on my site includes the session start function:
<?php session_start(); ?>
This is written in a "database.php" file which is subsequently included in every page on the site.
That is my problem and it's seriously hindering my progress on my website.
I have been on hundreds of threads about this (no exaggeration) and related problems and as of yet have no solution.
I would appreciate any replies with suggestions or even a solution because I'm tearing my hair out over this, so frustrating.

New Topic/Question
Reply



MultiQuote






|