NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
DebugBreak() starting php session for me?


Joined: 18 Jun 2007
Posts: 10
Reply with quote
Sample code:

<?
if(isset($_SESSION))
echo "foo";
if(session_id())
echo "session has an id";
?>
If you go to this page nothing is echo'ed


if you run this...

<?
debugBreak();
if(isset($_SESSION))
echo "foo\n";
if(session_id())
echo "session has an id";
?>

"foo session has an id" is printed.

This causes php notices that the session has already been started when i run session_start();


Linux
PHP 5.2.8
Nusphere 5.6 Build 5618
View user's profileFind all posts by saleen34Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Quote:
DebugBreak() starting php session for me?


It does never start php sessions. Debugger has absolutely no relation to php sessions. They use different cookie names: DBGSESSID and PHPSESSID respectively and can not make any influence on each other.

What you're observing is PHP session auto-start that always starts PHP session and therefore assigns PHP session ID on the 1st run, corresponding cookie comes back to the server on the 2nd run and you see PHP session ID assigned.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 18 Jun 2007
Posts: 10
Reply with quote
Thank you for the response. I am still confused though.
1. php auto start is turned off in my php.ini file.
If you take the debugBreak() out the third run of this file, the session is NOT set and the page is blank. Is anyone else experiencing this?
So, on the third run is the cookie wiped out? According to your explanation the cookie should return me the session ID again, but it doesn't.
thank you for taking time to respond
Nick
View user's profileFind all posts by saleen34Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Quote:
php auto start is turned off in my php.ini file


it's either your script starts PHP session or you're changing wrong php.ini while auto-start is still ON in the right php.ini, or you didn't restart web server after modified php.ini, or you have another php extension that starts php sessions for you. DBG can never start any PHP sessions.
Please check phpinfo() output.

Quote:
If you take the debugBreak() out the third run of this file, the session is NOT set and the page is blank


I've checked, your page is blank regardless debugBreak() is there or not. So there must be something wrong with your php configuration or with your script.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
DebugBreak() starting php session for me?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic