NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
PHP Session problem


Joined: 09 Nov 2004
Posts: 1
Reply with quote
All
I'm having trouble getting sites that I know work in the wild, to work in the IDE. My problem is with sessions, here's a two page test harness. I'm NOT running this in debugger althought the result is the same for me if I do.

index.php
<?php
$_SESSION['UID'] = 40;
header("Location: page2.php");
?>

page2.php
<?php
echo "Should be here";
echo $_SESSION['UID'];
?>

I get a strangly named file in the session.save_path (as expected) and $_SESSION['UID'] is set in the global watch window, but once we jump to page2.php $_SESSION is undeclared.


I found a strange thing, if I set php.ini session.auto_start to 0, run again and then set it back to back to 1, everthing then works for the duration of the IDE session (not php session), but when I restart the IDE, nothing again.

I've played with all combinations of session_start(), session_destroy(), but as I don't need them out in the wild. why should I need them in the IDE (they don't help me anyway).

Strange eh ??

BTW Great product, if only I could get past this behavour.
View user's profileFind all posts by mikegSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
I think there is nothing strange. Check $_COOKIE[] and make sure cookies are set. You may want to pass session ID via http/get variable as many people do. It works better. Also you may want to have permanent cookie for holding session ID instead of temporary one. Latter goes away when you leave the IDE.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
PHP Session problem
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