I m creating a very simple PHP-based program for warehousing but quite complicated back-end process.
So here is the situation:
I have the login page that directs to authorization page where it set the
session_name
for the first time,session_start()
and set the session variables.After the authorization page, it goes to the main.php page that is a table with left hand side for menu (links) that I also did
session_name()
<-- same name as the one created from (1), and start the session.On the right hand side of the main page is the iframe that display the page when user click the links on the left. I also did
session_name()
<-- same name as the one created from (1), and start the session.
Problem:
main.php is ok, it reads the session variable perfectly, but the iframe couldn't get the session variables (i tried to print_r($_SESSION)
, and came up empty). I tried var_dump(session_name("abc"))
, where "abc" is the session name that i used in (1), and it does show "abc", tried (isset($_SESSION)
) and returns true... so I don't know what am I doing wrong...
EDIT: I m sorry guys, i think i may have found the culprit... it is a logic error on my side... i have this condition to check every php page i created to destroy session when the user level is not authorized to use this current page. My bad.. thanks so much for your help guys!!