Mike -- ...and then Ford, Mike [LSS] said... % % On 14 October 2003 14:45, David T-G wrote: % % > ...and then Ford, Mike [LSS] said... % > % % > % On 14 October 2003 11:26, David T-G wrote: % > % % > % > I ran a phpinfo() comparison and didn't see anything markedly ... % > should provide, % > % > but I'm % > % > hesitant to % > % > bomb the list with two phpinfo() outputs :-) % > % > [Dude, what did you do to my paragraph formatting?!?] % % Not me, boss -- it's this crappy M$ Outlook thingie they force me to use at work... ;-Z
Bleah -- sucks to work there, man! But thanks for the help.
%
% > % Well, rather than post two complete phpinfos, can you hone
% > it down to just those entries which *are* different. I'd
% >
% > OLD:
% > session.use_trans_sid
% >
% > 1 1
% > NEW:
% >
% > session.use_trans_sid Off Off
%
% Oh-ho!! I'd seriously suspect this might have something to do with it. Set this
back to On on the new server and see what transpires.
Funny you should mention that... I took a look at this today and it had
magically been turned back on! Didn't matter, though -- and httpd was
restarted at least some hours after the ini file was modified, so it
should have picked up the change (and I checked phpinfo via httpd and it
shows on).
This is what lets me have sessions even without cookies, right? Yes,
this is a Good Thing(tm).
%
% > % It might also help to post a (short!) fragment of the relevant code.
%
% [...]
%
% > session_save ; # save for later
%
% Actually this looks a bit suspicious too -- I'm not 100% sure that session_save is
actually going to be called without parentheses () after it; that would certainly be
the case in most of the languages I'm used to, but I could be wrong for PHP. You
should also probably include a session_write_close() to make sure you completely close
out the session.
I fixed this and session_start but to no avail.
The demo code that our ISP (who built and manages the system) used to
prove that sessions were working is
<?php
session_start() ;
$_SESSION["count"]++ ;
print $_SESSION["count"] ;
?>
and, sure enough, the count goes up as you reload the page. Yay -- sort of.
So I stepped back and made *myself* a small page. It's
session_name('goof') ;
session_start ;
session_register('g') ;
$passwordcom = "G" ;
print "_POST IS<br><pre>." ; print_r($_POST) ; print ".</pre><br>\n"; ###
print "_SESSION IS<br><pre>." ; print_r($_SESSION) ; print ".</pre><br>\n"; ###
print "_SESSION[g] IS .$_SESSION[g].<br>\n"; ###
print "g IS .$g. AND passwordcom IS .$passwordcom.<br>\n"; ###
if ( $_SESSION[g] != $passwordcom ) # no password (yet)?
{
if ( $_SESSION[g] != "" ) # is this a second try?
{
print "Invalid Password. Authorized access only.<br> <br>\n" ;
# session_unregister('g') ;
}
echo "<form method='post'>";
print "Password:<br> <input type='password' name='g'>";
print "<br><br><br><center><input type='submit' value=' ENTER '>\n" ;
print "</form>\n";
session_write_close() ;
exit ; # nothing else to do
}
to mirror fairly closely the real page (in fact it's mostly taken from
the real page).
Something I realized as I was working on this is that we only ever refer
to the passed variable as $g (actually $pw). That smacks awfully of a
globals setting; $pw is set from $_SESSION[pw] when present. But all of
my global settings look the same.
The two results of this code are at
http://www.locations.org/sessions/testme.php
http://test.locations.org/sessions/testme.php
and are slightly different. I'm still not sure what to make of it
all and I definitely don't know where to go next :-(
TIA & HAND
:-D
--
David T-G * There is too much animal courage in
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
pgp00000.pgp
Description: PGP signature

