Re: [PHP] Session troubles

2002-01-03 Thread Sean LeBlanc

On 01-02 16:06, Jaime Bozza wrote:
 Returning false is invalid for the session read function, and has caused
 *MANY* issues with PHP and Sessions.  (Check the archives as well as the
 bugs database.  I have a couple in there myself)
 
 Change:
   return false;
 
 To:
   return '';
 
 And things should start working as expected.

As near as I can tell, things *are* working, but I'll change it to return
the ''. What an odd thing to require - I guess it's because it is expecting
a string in the true case. I've noticed that for the most part, PHP allows
you to do things very easily, is very extensible, and yet, for something so
(relatively) new, it has a lot of well, ugly, features like this. I don't
mean to knock the whole project, as it's very cool, and I'm sure very hard
work to maintain - but DB access is pretty weird, and the calls vary across
DBs - I ended up coding a bit of my own thin layer to generically call DB
functions, and not have to worry about mysql_foo, pgsql_foo, etc. It seems
that it would be pretty easy to have that as part of the language.

It's rough edges and strange issues like that that just make me scratch my
head.  Every single language I've worked with has them (what I call isms -
Java-isms, PowerBuilder-isms, C-isms - I can usually become productive with
the core of a language pretty quickly - usually inside of a week, as any
good programmer can, but the isms can be the part that take a few months
to get right - try telling any HR person/hiring manager that, and you won't
get far, though. :) They still want X years of Y, W years of Z, rather than
doing some simple aptitude type of testing, or going on recommendations,
nah, let's just scan resume for keywords and time periods...no wonder they
claimed they couldn't find people before the recession.), but PHP just
seems to have some really weird ones that you think would be easily
remedied.

That being said, doing session type stuff in PHP is still a ton easier and
more intuitive, IMHO, than mod_perl or some Java app servers. Also, since
it's a built-in, it's rare that from project to project it will vary. Even
when there are best practices for things like this in a
language/environment, I still seem to inherit code where people go skipping
down the bunny trail doing some weird and buggy stuff because they didn't
know what they were doing - when it's built in, that's less likely to
happen.  The db layer I mentioned above would prevent just this sort of
thing - maybe this is already a planned feature?

-- 
Sean LeBlanc:[EMAIL PROTECTED] Yahoo:seanleblancathome 
ICQ:138565743 MSN:seanleblancathome AIM:sleblancathome 
Errors using inadequate data are much less than those using no data at all. 
-Charles Babbage 
(contributed by Chris Johnston) 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session troubles

2002-01-02 Thread Sean LeBlanc

On 01-02 07:45, Jaime Bozza wrote:
 I agree.  Perhaps make a feature request that disallows session starting
 if save_handler=user and you haven't defined a session handler?Then
 it could spit out a more correct error message.

Blast. I am still unable to get my own session handler to work. My session
handler's write never gets called; only my session_open and session_read get
calledthe default file session handler still works, if I change
save_handler back to file instead of user.

As for the feature request, I guess I could - is there a mechanism to do
this outlined somewhere?


 -Original Message-
 From: Sean LeBlanc [mailto:[EMAIL PROTECTED]] 
 Sent: Tuesday, January 01, 2002 8:32 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Session troubles
 
 
 On 12-31 09:23, Jaime Bozza wrote:
  Sean,
From your php error_log, it's saying the following:
  Failed to write session data (user)
  
which sounds like it's having problems writing to the user-defined 
  session handler.  Are you using a user-defined session handler?  If 
  not, make sure your php.ini file has:
  
  session.save_handler = files
  
  And *NOT*:
  session.save_handler = user
  
  That will make a big difference.
 
 Good eye. That was it. I *did* have it as user because I was trying to
 do my own user-defined session handler, and then stepped back and was
 just trying to get the simpler case to work, w/o changing it back. 
 
 Thanks, it works now!
 
 Now, I just need to see if I can get my session_handler working...
 
 It's too bad the error message isn't more descriptive for this, BTW...
 
 
  -Original Message-
  From: Sean LeBlanc [mailto:[EMAIL PROTECTED]]
  Sent: Saturday, December 29, 2001 1:21 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] Session troubles
  
  
  On 12-29 12:56, David Jackson wrote:
   Sean --
   Don't know if this help but here's what I just worked for me. What
   ver. of PHP are you using? It seem to me that 3.x.x needs
   PHPLIB: http://sourceforge.net/projects/phplib
   to handle sessions?  -- David Jackson
   
   --- sean.php ---
   ?php include(seaninc.php); ?
   
   --- seaninc.php --
   ?php
   session_start();
   session_register(i);
   $i++;
   echo $i;
   ?
  
  I'm using 4.0.6. I believe session handling was added as part of 
  standard 4.x, right (if configured to compile it)?
  
  Some more info: I tried with Konqueror, as I know a cookie needs to be
 
  sent during the session_start() phase - I did get a dialog pop-up 
  asking if I wanted to accept the cookie, but I still got the error:
  
  Fatal error: Failed to initialize session module in 
  /usr/local/apache/htdocs/sesstest.php on line 2
  
  It says line 2 because I deleted some white space and commented out 
  code thas was before session_start().
  
  I set logging errors on, and sent it to syslog. Here's what it says: 
  Dec 29 12:12:57 free httpd: PHP Fatal error:  Failed to initialize 
  session module in /usr/local/apache/htdocs/sesstest.php on line 2 Dec 
  29 12:12:57 free httpd: PHP Warning:  Failed to write session data 
  (user). Please verify that the current setting of session.save_path is
 
  correct
  (/tmp) in Unknown on line 0
  
  But /tmp exists, and is world writeable:
  
  free# ls -ld /tmp
  drwxrwxrwt  16 root  wheel  1024 Dec 29 12:14 /tmp
  
On 12-29 09:59, Miles Thompson wrote:
Sean,

What's going on in incl.php. Are you issuing a session_start()?

No, I was not.

What if it's rearranged like so, as I understand you have to
register the session variable  before using it.

include(incl.php);
session_start();
session_register(mine);
$mine++;
echo $mine;

No dice, either. Actually, I had tried several permutations of the
order  before posting. :)


There's the divide and conquer approach too.  What do you see if
you comment out the include, then issue a phpinfo() and a die()?

Okay, I tried commenting out include, resulting in this code:

session_start();
session_register(i);
$i++;
echo $i;

When I run the above, I get this:
Fatal error: Failed to initialize session module in
/usr/local/apache/htdocs/sesstest.php on line 6

Which is getting somewhere, in a way. Line 6 is session_start();

What part from phpinfo() output were you interested in? Or did you
want to see all of it?

Thanks for the help.


HTH and Merry Christmas / Happy New Year - Miles Thompson

On Friday 28 December 2001 11:26 pm, Sean LeBlanc wrote:
 I asked this on php-install list, but got no response so here
 goes...

 I simply cannot get session to work correctly. Here's the test
 script:

 include(incl.php);
 session_start();
 $mine++;
 session_register(mine);
 echo $mine;

 incl.php includes code to save/retrieve session information
 to/from DB.  It calles

Re: [PHP] Session troubles

2002-01-02 Thread Sean LeBlanc

On 01-02 14:31, Jaime Bozza wrote:
 What do you have for the return values for your session_read function?
 (Specifically, what do you return when there's no data available?)

Well, it turns out that write *is* being called, but due to some feature of
session write, echo and print don't work, as I read on bugs.php.net. So I
put a file-writing mechanism in there and I see it is being called and what
was happening. I was trying to do an insert all the time, due to bad logic,
so it was cycling to 2, then stopping. Now it seems to work properly. :)

As for the session read, I return false when no value is found.

 
 Jaime Bozza
 
 
 -Original Message-
 From: Sean LeBlanc [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, January 02, 2002 11:20 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Session troubles
 
 
 On 01-02 07:45, Jaime Bozza wrote:
  I agree.  Perhaps make a feature request that disallows session
 starting
  if save_handler=user and you haven't defined a session handler?
 Then
  it could spit out a more correct error message.
 
 Blast. I am still unable to get my own session handler to work. My
 session handler's write never gets called; only my session_open and
 session_read get calledthe default file session handler still works,
 if I change save_handler back to file instead of user.
 
 As for the feature request, I guess I could - is there a mechanism to do
 this outlined somewhere?
 
 
  -Original Message-
  From: Sean LeBlanc [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, January 01, 2002 8:32 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] Session troubles
  
  
  On 12-31 09:23, Jaime Bozza wrote:
   Sean,
 From your php error_log, it's saying the following:
 Failed to write session data (user)
   
 which sounds like it's having problems writing to the user-defined
   session handler.  Are you using a user-defined session handler?  If 
   not, make sure your php.ini file has:
   
 session.save_handler = files
   
   And *NOT*:
 session.save_handler = user
   
   That will make a big difference.
  
  Good eye. That was it. I *did* have it as user because I was trying 
  to do my own user-defined session handler, and then stepped back and 
  was just trying to get the simpler case to work, w/o changing it back.
  
  Thanks, it works now!
  
  Now, I just need to see if I can get my session_handler working...
  
  It's too bad the error message isn't more descriptive for this, BTW...
  
  
   -Original Message-
   From: Sean LeBlanc [mailto:[EMAIL PROTECTED]]
   Sent: Saturday, December 29, 2001 1:21 PM
   To: [EMAIL PROTECTED]
   Subject: Re: [PHP] Session troubles
   
   
   On 12-29 12:56, David Jackson wrote:
Sean --
Don't know if this help but here's what I just worked for me. What
 
ver. of PHP are you using? It seem to me that 3.x.x needs
PHPLIB: http://sourceforge.net/projects/phplib
to handle sessions?  -- David Jackson

--- sean.php ---
?php include(seaninc.php); ?

--- seaninc.php --
?php
session_start();
session_register(i);
$i++;
echo $i;
?
   
   I'm using 4.0.6. I believe session handling was added as part of
   standard 4.x, right (if configured to compile it)?
   
   Some more info: I tried with Konqueror, as I know a cookie needs to 
   be
  
   sent during the session_start() phase - I did get a dialog pop-up
   asking if I wanted to accept the cookie, but I still got the error:
   
   Fatal error: Failed to initialize session module in
   /usr/local/apache/htdocs/sesstest.php on line 2
   
   It says line 2 because I deleted some white space and commented out
   code thas was before session_start().
   
   I set logging errors on, and sent it to syslog. Here's what it says:
   Dec 29 12:12:57 free httpd: PHP Fatal error:  Failed to initialize 
   session module in /usr/local/apache/htdocs/sesstest.php on line 2
 Dec 
   29 12:12:57 free httpd: PHP Warning:  Failed to write session data 
   (user). Please verify that the current setting of session.save_path
 is
  
   correct
   (/tmp) in Unknown on line 0
   
   But /tmp exists, and is world writeable:
   
   free# ls -ld /tmp
   drwxrwxrwt  16 root  wheel  1024 Dec 29 12:14 /tmp
   
 On 12-29 09:59, Miles Thompson wrote:
 Sean,
 
 What's going on in incl.php. Are you issuing a session_start()?
 
 No, I was not.
 
 What if it's rearranged like so, as I understand you have to 
 register the session variable  before using it.
 
 include(incl.php);
 session_start();
 session_register(mine);
 $mine++;
 echo $mine;
 
 No dice, either. Actually, I had tried several permutations of 
 the order  before posting. :)
 
 
 There's the divide and conquer approach too.  What do you see 
 if you comment out the include, then issue a phpinfo() and a 
 die()?
 
 Okay, I tried commenting out include, resulting in this code

Re: [PHP] Session troubles

2002-01-01 Thread Sean LeBlanc

On 12-31 09:23, Jaime Bozza wrote:
 Sean,
   From your php error_log, it's saying the following:
   Failed to write session data (user)
 
   which sounds like it's having problems writing to the user-defined
 session handler.  Are you using a user-defined session handler?  If not,
 make sure your php.ini file has:
 
   session.save_handler = files
 
 And *NOT*:
   session.save_handler = user
 
 That will make a big difference.

Good eye. That was it. I *did* have it as user because I was trying to do
my own user-defined session handler, and then stepped back and was just
trying to get the simpler case to work, w/o changing it back. 

Thanks, it works now!

Now, I just need to see if I can get my session_handler working...

It's too bad the error message isn't more descriptive for this, BTW...


 -Original Message-
 From: Sean LeBlanc [mailto:[EMAIL PROTECTED]] 
 Sent: Saturday, December 29, 2001 1:21 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Session troubles
 
 
 On 12-29 12:56, David Jackson wrote:
  Sean --
  Don't know if this help but here's what I just worked for me. What 
  ver. of PHP are you using? It seem to me that 3.x.x needs
  PHPLIB: http://sourceforge.net/projects/phplib
  to handle sessions?  -- David Jackson
  
  --- sean.php ---
  ?php include(seaninc.php); ?
  
  --- seaninc.php --
  ?php
  session_start();
  session_register(i);
  $i++;
  echo $i;
  ?
 
 I'm using 4.0.6. I believe session handling was added as part of
 standard 4.x, right (if configured to compile it)? 
 
 Some more info: I tried with Konqueror, as I know a cookie needs to be
 sent during the session_start() phase - I did get a dialog pop-up asking
 if I wanted to accept the cookie, but I still got the error:
 
 Fatal error: Failed to initialize session module in
 /usr/local/apache/htdocs/sesstest.php on line 2
 
 It says line 2 because I deleted some white space and commented out code
 thas was before session_start().
 
 I set logging errors on, and sent it to syslog. Here's what it says: Dec
 29 12:12:57 free httpd: PHP Fatal error:  Failed to initialize session
 module in /usr/local/apache/htdocs/sesstest.php on line 2 Dec 29
 12:12:57 free httpd: PHP Warning:  Failed to write session data (user).
 Please verify that the current setting of session.save_path is correct
 (/tmp) in Unknown on line 0
 
 But /tmp exists, and is world writeable:
 
 free# ls -ld /tmp
 drwxrwxrwt  16 root  wheel  1024 Dec 29 12:14 /tmp
 
   On 12-29 09:59, Miles Thompson wrote:
   Sean,
   
   What's going on in incl.php. Are you issuing a session_start()?
   
   No, I was not.
   
   What if it's rearranged like so, as I understand you have to 
   register the session variable  before using it.
   
   include(incl.php);
   session_start();
   session_register(mine);
   $mine++;
   echo $mine;
   
   No dice, either. Actually, I had tried several permutations of the 
   order  before posting. :)
   
   
   There's the divide and conquer approach too.  What do you see if 
   you comment out the include, then issue a phpinfo() and a die()?
   
   Okay, I tried commenting out include, resulting in this code:
   
   session_start();
   session_register(i);
   $i++;
   echo $i;
   
   When I run the above, I get this:
   Fatal error: Failed to initialize session module in 
   /usr/local/apache/htdocs/sesstest.php on line 6
   
   Which is getting somewhere, in a way. Line 6 is session_start();
   
   What part from phpinfo() output were you interested in? Or did you 
   want to see all of it?
   
   Thanks for the help.
   
   
   HTH and Merry Christmas / Happy New Year - Miles Thompson
   
   On Friday 28 December 2001 11:26 pm, Sean LeBlanc wrote:
I asked this on php-install list, but got no response so here 
goes...
   
I simply cannot get session to work correctly. Here's the test
script:
   
include(incl.php);
session_start();
$mine++;
session_register(mine);
echo $mine;
   
incl.php includes code to save/retrieve session information 
to/from DB.  It calles session_set_save_handler at the end.
   
What happens is I get an error because it is trying to read the 
variable out and I get a DB error, but my session writing routine
 
is never called...I know, because I have a print in there. And of
 
course, the var doesn't increment upon refreshes - it remains 1.
   
I've seen this before, and it was fixed, but I forget how it was 
done, as I didn't actually implement the solution (I hear and I 
forget, I do and I remember, I guess). About my system:
   
FreeBSD 4.4
Apache 1.3.20
PHP 4.0.6
   
Any and all help appreciated.
   
   --
   Sean LeBlanc:[EMAIL PROTECTED] Yahoo:seanleblancathome 
   ICQ:138565743 MSN:seanleblancathome AIM:sleblancathome 
   One learns to itch where one can scratch. 
   -Ernest Bramah 
   Management QOTD:Get hopping on the domain expertise!!
   
   
   --
   PHP General Mailing List (http

Re: [PHP] Session troubles

2001-12-30 Thread Sean LeBlanc

On 12-29 22:27, David Jackson wrote:
 Sean --
 
 Does you standard (non session) seem to work ok? Such as:
 ?php 
 // basic echo of var from form
 echo We've just echoed var from form\n;
 echo p$stuff/p;
 echo h2$more_stuff/h2;
 echo h3$still_more_stuff/h3;
 ?

Yes, this works fine. I should have said that before...

 Did you compile Apache and PHP from source? If so
 could you provide me with the ./configure --options you used?
 This is sound like a config/compile problem to me. 

This is what phpinfo() reports for PHP:

'./configure' '--with-apxs=/usr/local/sbin/apxs'
'--with-config-file-path=/usr/local/etc' '--enable-versioning'
'--with-system-regex' '--disable-debug' '--enable-track-vars' '--without-gd'
'--without-mysql' '--enable-session' '--with-zlib' '--with-mysql=/usr/local'
'--with-pgsql=/usr/local' '--with-openssl=/usr' '--with-session'
'--prefix=/usr/local' 'i386--freebsd4.4'

I built PHP from the FreeBSD ports collection. When I ran make, in the menu that
comes up, I selected transparent session, among other options.

As for Apache...I forget how I installed it. It doesn't appear that I built
it from the ports section, so it was either via a package or a tarball - so
I'm doing it from ports right now to be sure. We'll see how that goes.

 You might also want to cross-post to linux-admin mail list?

I'm using FreeBSD. :) I may post to one of the FreeBSD lists eventually, but
they can sometimes get irritatable when it's not on-topic...

-- 
Sean LeBlanc:[EMAIL PROTECTED] Yahoo:seanleblancathome 
ICQ:138565743 MSN:seanleblancathome AIM:sleblancathome 
We are born to action; and whatever is capable of suggesting and guiding 
action has power over us from the first. 
-Charles Horton Cooley 
Management QOTD:It's an orthogonal issue to identify the core product families
and staff appropriately for the process innovation, etc.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session troubles

2001-12-29 Thread Sean LeBlanc

On 12-29 09:59, Miles Thompson wrote:
 Sean,
 
 What's going on in incl.php. Are you issuing a session_start()?

No, I was not.

 What if it's rearranged like so, as I understand you have to register the session 
variable 
 before using it.
 
 include(incl.php);
 session_start();
 session_register(mine);
 $mine++;
 echo $mine;

No dice, either. Actually, I had tried several permutations of the order  before
posting. :)

 
 There's the divide and conquer approach too.  What do you see if you comment out the 
include,
 then issue a phpinfo() and a die()?

Okay, I tried commenting out include, resulting in this code:

session_start();
session_register(i);
$i++;
echo $i;

When I run the above, I get this:
Fatal error: Failed to initialize session module in
/usr/local/apache/htdocs/sesstest.php on line 6

Which is getting somewhere, in a way. Line 6 is session_start(); 

What part from phpinfo() output were you interested in? Or did you want to
see all of it?

Thanks for the help. 

 
 HTH and Merry Christmas / Happy New Year - Miles Thompson
 
 On Friday 28 December 2001 11:26 pm, Sean LeBlanc wrote:
  I asked this on php-install list, but got no response so here goes...
 
  I simply cannot get session to work correctly. Here's the test script:
 
  include(incl.php);
  session_start();
  $mine++;
  session_register(mine);
  echo $mine;
 
  incl.php includes code to save/retrieve session information to/from DB.  It
  calles session_set_save_handler at the end.
 
  What happens is I get an error because it is trying to read the variable
  out and I get a DB error, but my session writing routine is never
  called...I know, because I have a print in there. And of course, the var
  doesn't increment upon refreshes - it remains 1.
 
  I've seen this before, and it was fixed, but I forget how it was done, as I
  didn't actually implement the solution (I hear and I forget, I do and I
  remember, I guess). About my system:
 
  FreeBSD 4.4
  Apache 1.3.20
  PHP 4.0.6
 
  Any and all help appreciated.

-- 
Sean LeBlanc:[EMAIL PROTECTED] Yahoo:seanleblancathome 
ICQ:138565743 MSN:seanleblancathome AIM:sleblancathome 
One learns to itch where one can scratch. 
-Ernest Bramah 
Management QOTD:Get hopping on the domain expertise!!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session troubles

2001-12-29 Thread Sean LeBlanc

On 12-29 12:56, David Jackson wrote:
 Sean --
 Don't know if this help but here's what I just worked for me.
 What ver. of PHP are you using? It seem to me that 3.x.x needs 
 PHPLIB: http://sourceforge.net/projects/phplib
 to handle sessions?  -- David Jackson
 
 --- sean.php ---
 ?php include(seaninc.php); ?
 
 --- seaninc.php --
 ?php
 session_start();
 session_register(i);
 $i++;
 echo $i;
 ?

I'm using 4.0.6. I believe session handling was added as part of standard
4.x, right (if configured to compile it)? 

Some more info: I tried with Konqueror, as I know a cookie needs to be sent
during the session_start() phase - I did get a dialog pop-up asking if I
wanted to accept the cookie, but I still got the error:

Fatal error: Failed to initialize session module in
/usr/local/apache/htdocs/sesstest.php on line 2

It says line 2 because I deleted some white space and commented out
code thas was before session_start().

I set logging errors on, and sent it to syslog. Here's what it says:
Dec 29 12:12:57 free httpd: PHP Fatal error:  Failed to initialize session
module in /usr/local/apache/htdocs/sesstest.php on line 2
Dec 29 12:12:57 free httpd: PHP Warning:  Failed to write session data
(user). Please verify that the current setting of session.save_path is
correct (/tmp) in Unknown on line 0

But /tmp exists, and is world writeable:

free# ls -ld /tmp
drwxrwxrwt  16 root  wheel  1024 Dec 29 12:14 /tmp

  On 12-29 09:59, Miles Thompson wrote:
  Sean,
  
  What's going on in incl.php. Are you issuing a session_start()?
  
  No, I was not.
  
  What if it's rearranged like so, as I understand you have to register
  the session variable  before using it.
  
  include(incl.php);
  session_start();
  session_register(mine);
  $mine++;
  echo $mine;
  
  No dice, either. Actually, I had tried several permutations of the
  order  before posting. :)
  
  
  There's the divide and conquer approach too.  What do you see if you
  comment out the include, then issue a phpinfo() and a die()?
  
  Okay, I tried commenting out include, resulting in this code:
  
  session_start();
  session_register(i);
  $i++;
  echo $i;
  
  When I run the above, I get this:
  Fatal error: Failed to initialize session module in
  /usr/local/apache/htdocs/sesstest.php on line 6
  
  Which is getting somewhere, in a way. Line 6 is session_start(); 
  
  What part from phpinfo() output were you interested in? Or did you want
  to see all of it?
  
  Thanks for the help. 
  
  
  HTH and Merry Christmas / Happy New Year - Miles Thompson
  
  On Friday 28 December 2001 11:26 pm, Sean LeBlanc wrote:
   I asked this on php-install list, but got no response so here
   goes...
  
   I simply cannot get session to work correctly. Here's the test
   script:
  
   include(incl.php);
   session_start();
   $mine++;
   session_register(mine);
   echo $mine;
  
   incl.php includes code to save/retrieve session information to/from
   DB.  It calles session_set_save_handler at the end.
  
   What happens is I get an error because it is trying to read the
   variable out and I get a DB error, but my session writing routine is
   never called...I know, because I have a print in there. And of
   course, the var doesn't increment upon refreshes - it remains 1.
  
   I've seen this before, and it was fixed, but I forget how it was
   done, as I didn't actually implement the solution (I hear and I
   forget, I do and I remember, I guess). About my system:
  
   FreeBSD 4.4
   Apache 1.3.20
   PHP 4.0.6
  
   Any and all help appreciated.
  
  -- 
  Sean LeBlanc:[EMAIL PROTECTED] Yahoo:seanleblancathome 
  ICQ:138565743 MSN:seanleblancathome AIM:sleblancathome 
  One learns to itch where one can scratch. 
  -Ernest Bramah 
  Management QOTD:Get hopping on the domain expertise!!
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
  [EMAIL PROTECTED]
 
 
 -- 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
Sean LeBlanc:[EMAIL PROTECTED] Yahoo:seanleblancathome 
ICQ:138565743 MSN:seanleblancathome AIM:sleblancathome 
In most countries selling harmful things like drugs is punishable. Then 
howcome people can sell Microsoft software and go unpunished? 
-Hasse Skrifvars 
Management QOTD:Work out a solution that fits with problem management!!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Session troubles

2001-12-29 Thread Sean LeBlanc

On 12-29 15:10, David Jackson wrote:
 Sean --
 Do you get the same errors, with Netscape 4.x?

Yep. The very same. I've tried Galeon, Mozilla, Netscape 4.x, and Konqueror.
They all result in the same error.

  On 12-29 12:56, David Jackson wrote:
  Sean --
  Don't know if this help but here's what I just worked for me.
  What ver. of PHP are you using? It seem to me that 3.x.x needs 
  PHPLIB: http://sourceforge.net/projects/phplib
  to handle sessions?  -- David Jackson
  
  --- sean.php ---
  ?php include(seaninc.php); ?
  
  --- seaninc.php --
  ?php
  session_start();
  session_register(i);
  $i++;
  echo $i;
  ?
  
  I'm using 4.0.6. I believe session handling was added as part of
  standard 4.x, right (if configured to compile it)? 
  
  Some more info: I tried with Konqueror, as I know a cookie needs to be
  sent during the session_start() phase - I did get a dialog pop-up
  asking if I wanted to accept the cookie, but I still got the error:
  
  Fatal error: Failed to initialize session module in
  /usr/local/apache/htdocs/sesstest.php on line 2
  
  It says line 2 because I deleted some white space and commented out
  code thas was before session_start().
  
  I set logging errors on, and sent it to syslog. Here's what it says:
  Dec 29 12:12:57 free httpd: PHP Fatal error:  Failed to initialize
  session module in /usr/local/apache/htdocs/sesstest.php on line 2
  Dec 29 12:12:57 free httpd: PHP Warning:  Failed to write session data
  (user). Please verify that the current setting of session.save_path is
  correct (/tmp) in Unknown on line 0
  
  But /tmp exists, and is world writeable:
  
  free# ls -ld /tmp
  drwxrwxrwt  16 root  wheel  1024 Dec 29 12:14 /tmp
  
   On 12-29 09:59, Miles Thompson wrote:
   Sean,
   
   What's going on in incl.php. Are you issuing a session_start()?
   
   No, I was not.
   
   What if it's rearranged like so, as I understand you have to
   register the session variable  before using it.
   
   include(incl.php);
   session_start();
   session_register(mine);
   $mine++;
   echo $mine;
   
   No dice, either. Actually, I had tried several permutations of the
   order  before posting. :)
   
   
   There's the divide and conquer approach too.  What do you see if
   you comment out the include, then issue a phpinfo() and a die()?
   
   Okay, I tried commenting out include, resulting in this code:
   
   session_start();
   session_register(i);
   $i++;
   echo $i;
   
   When I run the above, I get this:
   Fatal error: Failed to initialize session module in
   /usr/local/apache/htdocs/sesstest.php on line 6
   
   Which is getting somewhere, in a way. Line 6 is session_start(); 
   
   What part from phpinfo() output were you interested in? Or did you
   want to see all of it?
   
   Thanks for the help. 
   
   
   HTH and Merry Christmas / Happy New Year - Miles Thompson
   
   On Friday 28 December 2001 11:26 pm, Sean LeBlanc wrote:
I asked this on php-install list, but got no response so here
goes...
   
I simply cannot get session to work correctly. Here's the test
script:
   
include(incl.php);
session_start();
$mine++;
session_register(mine);
echo $mine;
   
incl.php includes code to save/retrieve session information
to/from DB.  It calles session_set_save_handler at the end.
   
What happens is I get an error because it is trying to read the
variable out and I get a DB error, but my session writing routine
is never called...I know, because I have a print in there. And of
course, the var doesn't increment upon refreshes - it remains 1.
   
I've seen this before, and it was fixed, but I forget how it was
done, as I didn't actually implement the solution (I hear and I
forget, I do and I remember, I guess). About my system:
   
FreeBSD 4.4
Apache 1.3.20
PHP 4.0.6
   
Any and all help appreciated.
   
   -- 
   Sean LeBlanc:[EMAIL PROTECTED] Yahoo:seanleblancathome 
   ICQ:138565743 MSN:seanleblancathome AIM:sleblancathome 
   One learns to itch where one can scratch. 
   -Ernest Bramah 
   Management QOTD:Get hopping on the domain expertise!!
   
   
   -- 
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED] To
   contact the list administrators, e-mail:
   [EMAIL PROTECTED]
  
  
  -- 
  
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
  [EMAIL PROTECTED]
  
  -- 
  Sean LeBlanc:[EMAIL PROTECTED] Yahoo:seanleblancathome 
  ICQ:138565743 MSN:seanleblancathome AIM:sleblancathome 
  In most countries selling harmful things like drugs is punishable. Then
   howcome people can sell Microsoft software and go unpunished? 
  -Hasse Skrifvars 
  Management QOTD:Work out a solution that fits with problem management

Re: [PHP] Session troubles

2001-12-29 Thread Sean LeBlanc

On 12-29 16:46, David Jackson wrote:
 Sean --
 
 Give the attached scripts a shot, a post the results.
 
 Note: Xitami(server+WinMe) + IE5.5 or Mozilla 9.7 works 
 fine but with Netscape-4.9 it returns var names? But
 when served from Unix/Linux and Apache all 3 work as expected !!
 
 Anywhy give them shot. -- David

I created and ran these. After hitting submit on form.html, I get this:

Fatal error: Failed to initialize session module in
/usr/local/apache/htdocs/form.php on line 3

 
 --- form.html ---
 ?xml version=1.0 encoding=iso-8859-1?
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
 head
   meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /
   titleNo title/title
   meta name=GENERATOR content=amaya 5.2 /
 /head
 body
 
 form method=post action=form.php
   pinput type=text size=20 name=stuff //p
   pinput type=text size=20 name=more_stuff //p
   pinput type=text size=20 name=still_more_stuff //p
 
 pinput type=submit value=Submit //p
 pinput type=reset value=Reset //p
 /form
 /body
 /html
 
 --- form.php 
 
 ?php 
 // sessions  on 48 N. Random Rd.
 session_start();
 session_register('Green');
 session_register('Yellow');
 session_register('Red');
 $Green  =  $stuff;
 $Yellow = $more_stuff;
 $Red = $still_more_stuff;
 
 // basic echo of var from form
 echo We've just echoed var from form\n;
 echo p$Green/p;
 echo h2$Yellow/h2;
 echo h3$Red/h3;
 echo pa href=\form02.php\Verify that session_vars were 
 passwd/a/p;
 // Get out of here
 
 ?
 
 --- form02.php -
 ?php 
 session_start();
 // sessions  on 48 N. Random Rd.
 // basic echo of var from form
 echo htmlheadtitle/title/head;
 echo body;
 echo h2session_registers:;
 echo pGreen:$Green/p;
 echo pYellow:$Yellow/p;
 echo pRed:$Red/p;
 echo /body/html;
 ?
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
Sean LeBlanc:[EMAIL PROTECTED] Yahoo:seanleblancathome 
ICQ:138565743 MSN:seanleblancathome AIM:sleblancathome 
One lives in the hope of becoming a memory. 
-Antonio Porchia 
Management QOTD:I am very concerned that we may not give a dog and pony show
and examine where the rubber meets the road on the deliverables,
etc.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Session troubles

2001-12-28 Thread Sean LeBlanc

I asked this on php-install list, but got no response so here goes...

I simply cannot get session to work correctly. Here's the test script:

include(incl.php);
session_start();
$mine++;
session_register(mine);
echo $mine;

incl.php includes code to save/retrieve session information to/from DB.  It
calles session_set_save_handler at the end.

What happens is I get an error because it is trying to read the variable out
and I get a DB error, but my session writing routine is never called...I
know, because I have a print in there. And of course, the var doesn't
increment upon refreshes - it remains 1.

I've seen this before, and it was fixed, but I forget how it was done, as I
didn't actually implement the solution (I hear and I forget, I do and I
remember, I guess). About my system:

FreeBSD 4.4
Apache 1.3.20
PHP 4.0.6

Any and all help appreciated.


-- 
Sean LeBlanc:[EMAIL PROTECTED] Yahoo:seanleblancathome 
ICQ:138565743 MSN:seanleblancathome AIM:sleblancathome 
A billion hours ago, human life appeared on earth. A billion minutes ago, 
Christianty emerged. A billion Coca-Colas ago was yesterday morning. 
-1996 Coca-Cola Company annual report 
Management QOTD:No one doubts that we should right size and analyze progress
on the market forces.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Getting session to work

2001-10-22 Thread Sean LeBlanc

I'm trying to use my own session handler. I tried several
examples before trying it out on my local box. It worked,
and I don't know why it didn't work on the other. Here
are the setups:

My local box (where it works):
OS: Windows 2000
PHP 4.0.6
Apache 1.3.x

I didn't even have to set the handler setting from files to user, and it
worked.

Original box (where it does not work)
OS: FreeBSD 4.4
PHP 4.0.6
Apache 1.3.22


The session value basically doesn't get changed at all.
No errors get printed, just no change in session value.
The example I ended up finally using is the one described
here:
http://www.phpbuilder.com/columns/ying2602.php3

BTW, the vanilla session handler is not working under
the FreeBSD setup, either. This is the target platform,
so I really need to figure this out

Please, any and all help is appreciated!!!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Getting session to work

2001-10-22 Thread Sean LeBlanc

I wanted to add some more details:

Apache on Windows 2000 box is 1.3.20
Database connection to MySQL IS working,
so that's not the problem.

-Original Message-
From: Sean LeBlanc [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 22, 2001 9:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting session to work


I'm trying to use my own session handler. I tried several
examples before trying it out on my local box. It worked,
and I don't know why it didn't work on the other. Here
are the setups:

My local box (where it works):
OS: Windows 2000
PHP 4.0.6
Apache 1.3.x

I didn't even have to set the handler setting from files to user, and it
worked.

Original box (where it does not work)
OS: FreeBSD 4.4
PHP 4.0.6
Apache 1.3.22


The session value basically doesn't get changed at all.
No errors get printed, just no change in session value.
The example I ended up finally using is the one described
here:
http://www.phpbuilder.com/columns/ying2602.php3

BTW, the vanilla session handler is not working under
the FreeBSD setup, either. This is the target platform,
so I really need to figure this out

Please, any and all help is appreciated!!!


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]