As we know from this code:
- Code: Select all
if (!isset($_SESSION['user_name']) || !isset($_SESSION['user_password'])) {
header("Location: login.php");
}
?>
the abovve code is added to each page of my folder, assum its name is ABC.
The ABC folder and Forum folder (VB) are placed in my web.
(i.e. if you want to see ABC folder, the link becomes http://www.aaaa.com/ABC
and the same thing for VB
http://www.aaaa.com/VB)
The ABC folder contains many pages such as index.php, article.php, login.php ...etc
each page in this folder includes the SESSION as I wrote in the above.
Therefore, If you opened http://www.aaa.com/ABC/index.php , it will check if you logged in or not. if you not logged in, it will transfere you to login.php
The questions is:
How can I use the same SESSION of the VB? (i.e. if I logged in the VB forum, I will not need to go back to the login.php of the ABC folder when I want to open http://www.aaa.com/ABC/index.php)
I hope that it is clear to you.

Note: the above website is for example.

