Eiolon Posted November 20, 2008 Share Posted November 20, 2008 I have a header file that will be included on each page. Will I have problems if I put all the session information in the header file instead of each individual page? I am trying to not have to query user permissions in each page. I figured I would query for the user and its permissions in the header file and on the individual pages check to see if the user has permission to be on it. Also, would that mean I still need to declare session_start(); at the top of each page or just the header include file? Thanks. Link to comment https://forums.phpfreaks.com/topic/133568-question-about-sessions-and-includes/ Share on other sites More sharing options...
trq Posted November 20, 2008 Share Posted November 20, 2008 I figured I would query for the user and its permissions in the header file and on the individual pages check to see if the user has permission to be on it. Why not store this information in your users session once when they login? Then retrieve it whenever you need from the $_SESSION array. Link to comment https://forums.phpfreaks.com/topic/133568-question-about-sessions-and-includes/#findComment-694739 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.