• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

[PHP] line of code makes me lose my sessions

Giscardo

Senior member
I have an application that uses sessions to keep a user logged on throughout their visit to the site once they enter their username and password. I have found that a single line of code causes my sessions to die, or expire somehow. I'm using PHP4.0 and mySQL.

mysql_select_db("phpBB");

That's the line of code. It's called through an include file that i include at the top of all my pages which contains common functions and stuff. I tried to move the code to the page that includes this file but it still expires my session. As soon as i comment out this line of code though, my sessions stay alive. What gives? Am I using this function wrong? Am I not supposed to call it with each page? I'd say 80% of my pages use SQL queries, so i decided to move the code to connect to the database and select the db to a common include file.

Am I not supposed to call this in each php script on my site? If so, where do i call this function?
 
Do you have Session_start(); on all the pages?

also if you are using phpbb, what version are you using?
 
Back
Top