I have a login file with two fields: username and password
Because I want to use variable username for other .php files so I declare session in login.php file as:
... get username from a form.....
....get password ..................
Now I want to assign the variable username of that user to a variable name in other get_name.php file and show username's table as bellow:
session_start(); //to get username from login file
$name = $username;
...Show username's TABLE....
It is work well.
The new problem here is when I return "BACK" to previous login page and I login as another user (different with previous one), I went to the same page of the previous user, (that means it still show previous user's table)
I thought that I will use session_destroy() function like this:
session_destroy(); //destroy previous session
session_start(); //start new session
However, it still the same, after I login, I still went to the previous user's page !!!!!!!!!!!!!!!!.
(Please note that, I may use the same username variable for other pages)