[PHP] line of code makes me lose my sessions

Giscardo

Senior member
May 31, 2000
724
0
0
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?
 

Czar

Lifer
Oct 9, 1999
28,510
0
0
Do you have Session_start(); on all the pages?

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