PHP Session header problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

general sesison tips:
  • session_start() must be on all pages where sessions are to be accessed (unless you have auto-start enabled, not likely)
  • session_start() must be called before any output. This includes whitespace (carriage returns, spaces, tabs) any html, output from php.. anything, almost literally.
  • do not use session_register() and related functions if you use $_SESSION
  • you can store session data in the database if that helps... read the Useful Posts thread linked to in my signature for details
User avatar
robster3uk
Forum Newbie
Posts: 10
Joined: Wed Mar 02, 2005 2:26 am

Post by robster3uk »

I went with the option of just starting a session and just using a session id and store it in the database, that i generate at login. The only problem is that i have to pass it around in every page called while the user is online. It seems to be working anyway so...... Thanks for all your help guys.

:-)
Post Reply