Jump to content

Question about sessions and includes


Eiolon

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.