RE: [PHP] [Session]

2002-03-26 Thread Brian Drexler

Try using the same session variable.  Right now it looks like the first one
is "v_s" and the second is "s_v".  HTH.

Brian

-Original Message-
From: Evan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 2:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP] [Session]


Hi !!
I can't make this work:
PAGE 1:



SESSION 1





Variabile settata? --

link to next



In page 1 I create the session var and I check if it exists. The if stat
returns YES so it seems everything's ok.

PAGE 2:


SESSION 2








In page 2 I simply read the session var but it doesn't return anything.

I must leave register_globals = Off !
What's wrong?

Thanks,
Evan



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] [Session]

2002-03-26 Thread Erik Price


On Tuesday, March 26, 2002, at 02:14  PM, Evan wrote:

> Hi !!
> I can't make this work:
> PAGE 1:
>  $HTTP_SESSION_VARS["v_s"]=500;
> ?>
>

I am probably wrong about this, but I thought that you could register 
session variables using this technique only if you are using PHP 4.1.x 
and you use the format:

$_SESSION['v_s'] = 500;





Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] [Session]

2002-03-26 Thread Evan

> Try using the same session variable.  Right now it looks like the first
one
> is "v_s" and the second is "s_v".  HTH.
Ops

I changed it butit doesn't work! :-((
:_(

Evan

"Brian Drexler" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Try using the same session variable.  Right now it looks like the first
one
> is "v_s" and the second is "s_v".  HTH.
>
> Brian
>
> -Original Message-
> From: Evan [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 26, 2002 2:15 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] [Session]
>
>
> Hi !!
> I can't make this work:
> PAGE 1:
>  $HTTP_SESSION_VARS["v_s"]=500;
> ?>
> 
> 
> SESSION 1
> 
> 
>
> 
>
> Variabile settata? --
>  if (isset($HTTP_SESSION_VARS["v_s"])){
>  echo "si";
> }else{
>  echo "no";
> }
> ?>
> link to next
> 
> 
>
> In page 1 I create the session var and I check if it exists. The if stat
> returns YES so it seems everything's ok.
>
> PAGE 2:
> 
> 
> SESSION 2
> 
> 
>
> 
>  echo $HTTP_SESSION_VARS["s_v"];
> ?>
> 
> 
>
> In page 2 I simply read the session var but it doesn't return anything.
>
> I must leave register_globals = Off !
> What's wrong?
>
> Thanks,
> Evan
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] [Session]

2002-03-26 Thread Evan

I have PHP 4.1.2 (the latest, I downloaded it a week ago).
The manual says that:
*
If track_vars is enabled and register_globals is disabled, only members of
the global associative array $HTTP_SESSION_VARS can be registered as session
variables. The restored session variables will only be available in the
array $HTTP_SESSION_VARS.
*

I won't use $_SESSION cause it seems that is a bit buggy have a search
with google->user group "$_SESSION".

Anyway thanks for your interest,
Evan

"Erik Price" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> On Tuesday, March 26, 2002, at 02:14  PM, Evan wrote:
>
> > Hi !!
> > I can't make this work:
> > PAGE 1:
> >  > $HTTP_SESSION_VARS["v_s"]=500;
> > ?>
> >
>
> I am probably wrong about this, but I thought that you could register
> session variables using this technique only if you are using PHP 4.1.x
> and you use the format:
>
> $_SESSION['v_s'] = 500;
>
>
>
>
>
> Erik
>
>
>
>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] [Session]

2002-03-26 Thread Erik Price


On Tuesday, March 26, 2002, at 02:42  PM, Evan wrote:

> I have PHP 4.1.2 (the latest, I downloaded it a week ago).
> The manual says that:
> *
> If track_vars is enabled and register_globals is disabled, only members 
> of
> the global associative array $HTTP_SESSION_VARS can be registered as 
> session
> variables. The restored session variables will only be available in the
> array $HTTP_SESSION_VARS.
> *
>
> I won't use $_SESSION cause it seems that is a bit buggy have a 
> search
> with google->user group "$_SESSION".

Okay, suit yourself -- but a reminder that $_SESSION is the 'official' 
method of referring to the SESSION array, and that $HTTP_SESSION_VARS 
has been deprecated and may not be available in a later release of PHP, 
thus rendering your code obsolete if you should ever upgrade.  Read it 
for yourself, 
http://www.php.net/manual/en/language.variables.predefined.php


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] [Session]

2002-03-26 Thread Johnson, Kirk

> I am probably wrong about this, but I thought that you could register 
> session variables using this technique only if you are using 
> PHP 4.1.x 
> and you use the format:
> 
> $_SESSION['v_s'] = 500;

The key point is the register_globals setting in php.ini. If it is set to
on, then register variables this way, regardless of the version:

$v_s = 500;
session_register{'v_s');

If it is set to off, then do as above, assuming your version is new enough
to support the new array $_SESSION[]:

$_SESSION['v_s'] = 500;

The array $_SESSION[] is pretty new, maybe 4.1.2? Even with this new array,
you can still use the old method for registering variables. Also, in a
recent release, or else coming up shortly, the default setting for
register_globals will be changed from "on" to "off".

Kirk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] session

2002-04-02 Thread Steve Cayford

Try putting session_start() in your retief.php script as well as 
piet.php.

-Steve

On Wednesday, April 3, 2002, at 01:06  PM, R. Lindeman wrote:

> okay i've posted something before here are my scripts either you tell me
> what i do wrong or i'll go beserk
>
> you can check the outcome of the code on the following adress
>
> http://www.filenexus.com/piet.php
>
> here's the code for piet.php :
>
> 
> // open session and begin registering values
>
> session_start();
>
> session_register("fubar1");
> session_register("fubar2");
> session_register("fubar3");
>
> $fubar1="Remko";
>
> $fubar2="Lindeman";
>
> $fubar3="I3M1I";
>
> header("Location: retief.php?".SID);
>
> ?>
>
> here's the code for retief.php :
>
> 
> // begin the retrieval of propagated values
>
> $remko   = $HTTP_SESSION_VARS["fubar1"];
> $lindeman = $HTTP_SESSION_VARS["fubar2"];
> $klas   = $HTTP_SESSION_VARS["fubar3"];
>
> echo $remko;
> echo $lindeman;
> echo $klas;
>
> ?>
>
>
> the problem is that the values don't get registered
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] session

2002-04-02 Thread Erik Price


On Wednesday, April 3, 2002, at 02:06  PM, R. Lindeman wrote:

> // open session and begin registering values
>
> session_start();
>
> session_register("fubar1");
> session_register("fubar2");
> session_register("fubar3");
>
> $fubar1="Remko";
>
> $fubar2="Lindeman";
>
> $fubar3="I3M1I";

.
.
.

> the problem is that the values don't get registered

If you are using PHP 4.1.x or greater, then try using the following code 
to register your sessions -- it is easier and may work better.



If you're using PHP 4.0.x or lower, then nevermind, this won't help you.

Erik







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] session

2002-04-02 Thread Tom Rogers

Hi
You need session_start() on the retief.php page
Tom

At 05:06 AM 4/04/2002, R. Lindeman wrote:
>okay i've posted something before here are my scripts either you tell me
>what i do wrong or i'll go beserk
>
>you can check the outcome of the code on the following adress
>
>http://www.filenexus.com/piet.php
>
>here's the code for piet.php :
>
>
>// open session and begin registering values
>
>session_start();
>
>session_register("fubar1");
>session_register("fubar2");
>session_register("fubar3");
>
>$fubar1="Remko";
>
>$fubar2="Lindeman";
>
>$fubar3="I3M1I";
>
>header("Location: retief.php?".SID);
>
>?>
>
>here's the code for retief.php :
>
>
>// begin the retrieval of propagated values
>
>$remko   = $HTTP_SESSION_VARS["fubar1"];
>$lindeman = $HTTP_SESSION_VARS["fubar2"];
>$klas   = $HTTP_SESSION_VARS["fubar3"];
>
>echo $remko;
>echo $lindeman;
>echo $klas;
>
>?>
>
>
>the problem is that the values don't get registered
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Session

2001-11-15 Thread Rudolf Visagie

The problem lies with the fact that you have a variable 'name' that gets
posted in the form as well as a session variable 'name' that is passed to
the script when it is executed again. As far as I remember the session
variable supercedes the posted variable, so the session variable would
overwrite the value of the posted variable every time. You need to register
the session variable with another name and then toggle between the two
variables in you script.

Also, a session variable need only be registered once:
if (!session_is_registered("name")) {
session_register("name");
}

Rudolf Visagie
Principal Software Developer
Digital Healthcare Solutions
Tel. +27(0)11 266 6946
Fax. +27(0)11 266 5080
Cell: +27(0)82 895 1598
E-mail: [EMAIL PROTECTED]


-Original Message-
From: jtjohnston [mailto:[EMAIL PROTECTED]]
Sent: 15 November 2001 09:08
To: [EMAIL PROTECTED]
Subject: [PHP] Session


Hi,

I have read: http://www.php.net/manual/en/function.session-register.php

Could I ask you a question about how to set a session $vars in a ?
It seems to be quite a mystery/controversy!!

This is my problem:
http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/test_session.php

Type something.
Press submit.
Change your text and re-submit.

$name doesn't re-save itself. This is my code:
http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/test_session.php
s

Would you have any suggestions?
It can't be that complicated can it?

J.T-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]

-- 
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

2001-11-15 Thread George Whiffen

For the record:

You can control the order of precedence of variable reading
through a php.ini setting, variable_order, (replaces gpc_order).

I believe the default is EGPCS i.e. environment, get, post, cookie, session.

The last in the list takes precedence, i.e. session variables normally have precedence
over get/post variables

George

Rudolf Visagie wrote:
> 
> The problem lies with the fact that you have a variable 'name' that gets
> posted in the form as well as a session variable 'name' that is passed to
> the script when it is executed again. As far as I remember the session
> variable supercedes the posted variable, so the session variable would
> overwrite the value of the posted variable every time. You need to register
> the session variable with another name and then toggle between the two
> variables in you script.
> 
> Also, a session variable need only be registered once:
> if (!session_is_registered("name")) {
> session_register("name");
> }
> 
> Rudolf Visagie
> Principal Software Developer
> Digital Healthcare Solutions
> Tel. +27(0)11 266 6946
> Fax. +27(0)11 266 5080
> Cell: +27(0)82 895 1598
> E-mail: [EMAIL PROTECTED]
> 
> -Original Message-
> From: jtjohnston [mailto:[EMAIL PROTECTED]]
> Sent: 15 November 2001 09:08
> To: [EMAIL PROTECTED]
> Subject: [PHP] Session
> 
> Hi,
> 
> I have read: http://www.php.net/manual/en/function.session-register.php
> 
> Could I ask you a question about how to set a session $vars in a ?
> It seems to be quite a mystery/controversy!!
> 
> This is my problem:
> http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/test_session.php
> 
> Type something.
> Press submit.
> Change your text and re-submit.
> 
> $name doesn't re-save itself. This is my code:
> http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/test_session.php
> s
> 
> Would you have any suggestions?
> It can't be that complicated can it?
> 
> J.T-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]

-- 
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

2001-11-15 Thread Rudolf Visagie

Yep, 'variables_order'.

-Original Message-
From: George Whiffen [mailto:[EMAIL PROTECTED]]
Sent: 15 November 2001 06:30
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Session


For the record:

You can control the order of precedence of variable reading
through a php.ini setting, variable_order, (replaces gpc_order).

I believe the default is EGPCS i.e. environment, get, post, cookie, session.

The last in the list takes precedence, i.e. session variables normally have
precedence
over get/post variables

George

Rudolf Visagie wrote:
> 
> The problem lies with the fact that you have a variable 'name' that gets
> posted in the form as well as a session variable 'name' that is passed to
> the script when it is executed again. As far as I remember the session
> variable supercedes the posted variable, so the session variable would
> overwrite the value of the posted variable every time. You need to
register
> the session variable with another name and then toggle between the two
> variables in you script.
> 
> Also, a session variable need only be registered once:
> if (!session_is_registered("name")) {
> session_register("name");
> }
> 
> Rudolf Visagie
> Principal Software Developer
> Digital Healthcare Solutions
> Tel. +27(0)11 266 6946
> Fax. +27(0)11 266 5080
> Cell: +27(0)82 895 1598
> E-mail: [EMAIL PROTECTED]
> 
> -Original Message-
> From: jtjohnston [mailto:[EMAIL PROTECTED]]
> Sent: 15 November 2001 09:08
> To: [EMAIL PROTECTED]
> Subject: [PHP] Session
> 
> Hi,
> 
> I have read: http://www.php.net/manual/en/function.session-register.php
> 
> Could I ask you a question about how to set a session $vars in a ?
> It seems to be quite a mystery/controversy!!
> 
> This is my problem:
>
http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/test_session.php
> 
> Type something.
> Press submit.
> Change your text and re-submit.
> 
> $name doesn't re-save itself. This is my code:
>
http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/test_session.php
> s
> 
> Would you have any suggestions?
> It can't be that complicated can it?
> 
> J.T-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]

-- 
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]




Re: [PHP] session

2001-12-11 Thread Mehmet Kamil ERISEN

Hi,
I think you can include pages from other sites, servers.
SESSIONS (I think) are server specific, cuz the info is
kept on the server.  
If you tell me what u gonna be doing, I can give you ideas.
thx.
erisen
--- Jordan <[EMAIL PROTECTED]> wrote:
> is there anyway to drag session variables to another
> server or are they
> server specific?  If you can't drag a session can you do
> an include for a
> page on a different server giving it's URL?  Just
> curious.
> 
> -Jordan
> 
> 
> 
> -- 
> 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]
> 


=
Mehmet Erisen
http://www.erisen.com

__
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

-- 
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

2001-12-11 Thread Meir Kriheli

On Tuesday 11 December 2001 10:37, Jordan wrote:
> is there anyway to drag session variables to another server or are they
> server specific?  If you can't drag a session can you do an include for a
> page on a different server giving it's URL?  Just curious.
>
> -Jordan

That depends, 

You can store session data in a DB instead of files.

All servers sharing session vars should use this DB for session storage. This 
works if the servers are on the same site.

If the server is in some other place that is problem. Allowing access to your 
DB via the 'net is asking for trouble.
-- 
Meir Kriheli

-- 
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

2001-04-14 Thread Yasuo Ohgaki
I guess you are using "files" session module.
If you take a look at note in PHP Manual, there is my note why your session
files are not deleted.
(See Session reference)

Hope this helps.
--
Yasuo Ohgaki


""E K L"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>Is there anybody can help to do this:
>
>My web site has 3 pages :a.php, b.php and c.php. I want to capture the
> session in those 3 pages. Without an id, visitor can't view my page. When
> visitors leave the site, thier session should be removed.
>
>The problem is how to remove the session. I have tried several function
> of session such as session_destroy(), session_unregister. But, i still faild
> to clear the session. What should i do?
>
>   For ur information, the session.cookie_lifetime is set to 0 in my server.
> Should i   change the value? If yes, then how to do it? Please give me your
> hands, thank you
>
> E K
> _
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
> --
> 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]


Re: [PHP] session related

2002-01-11 Thread Andrey Hristov

Probably
1)You do echo before session_start()
2)You have white space before the opening 
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 10, 2002 11:00 PM
Subject: [PHP] session related


> i can't use session, give me an error when use ie 6.
>
> Warning: Cannot send session cookie - headers already sent by (output
> started at /home/www.apollodisplays.com/public_html/mainpage.php:10) in
> /home/www.apollodisplays.com/public_html/mainpage.php on line 29
>
> Warning: Cannot send session cache limiter - headers already sent
> (output started t
> /home/www.apollodisplays.com/public_html/mainpage.php:10) in
> /home/www.apollodisplays.com/public_html/mainpage.php on line 29
>
>
> my code is very simple. see below >
>
> session_start();
> session_register("userright");
> $HTTP_SESSION_VARS["userright"]=$right;
>
> anyone have any idea ?  thankx
>
>
>
>
>   _
>
> Mark Chin 
> Apollo Display Technologies, LLC
> 85 Remington Blvd. Ronkonkoma, NY 11779
> Ph. (631) 580-4360 EXT 19
> Fax (631) 580-4370
> http://www.apollodisplays.com
>
>


-- 
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 Help

2002-01-30 Thread Kevin Stone

This is such an annoying thing.  And it seems as though no one is
willing to cover it in any manual, book or tutorial.  Apparently the
problem is that PHP sessions automatically set the no-cache header.  So
at the top of each script, after the session_start() function set
header("Cache-Control: public");  That will the trick.  Actually it may
work too well but at least your visitors won't get discouraged by that
annoying message.

--
Kevin Stone
[EMAIL PROTECTED]

> -Original Message-
> From: Michael: Dave II, Electric Boogaloo
[mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 29, 2002 3:47 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Session Help
> 
> I'm having a little problem with my sessions on a website I'm
programming
> for.  After a user logs in, if that user follows a link, the variable
> information is being passed correctly, but when they hit "Back",
Internet
> Explorer gives a "Warning This Page Has Expired" error.  Hitting
refresh
> does fix this, but "Forward/Back" is such a common procedure that I'd
like
> for this to work smoothly.  Could someone tell me what I'm doing wrong
> here?
> 
> Thanks in advance.
> 
> 
> Michael
> 
> 
> 
> --
> 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]




Re: [PHP] session register!!

2002-02-08 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Cristian Cerda declared
> Hi there, hope you can help me with my problem.
> 
> I'm trying to set up a PHP/MySQL web site using session variables to
> pass information between pages. So far no good.
> 
> I did set register_globals to On on the php.ini file. But when i use for
> example session_register("the_var") in one page ( using session_start()
> at the beginning), i don't get anything on the next page if i do echo
> $the_var .

Did you set your $the_var?

Like:

session_start();
session_register('the_var');

$the_var="is this the problem?";

- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8ZCj4HpvrrTa6L5oRAoQJAJ91jzJYx0KV9Su+8/aJuoIURDNEYACeINDf
StxfV0PhCeYfeGNWM17XFOM=
=1Rrm
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] session register!!

2002-02-08 Thread Cristian Cerda

yes i did.

Nick Wilson wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> * and then Cristian Cerda declared
> > Hi there, hope you can help me with my problem.
> >
> > I'm trying to set up a PHP/MySQL web site using session variables to
> > pass information between pages. So far no good.
> >
> > I did set register_globals to On on the php.ini file. But when i use for
> > example session_register("the_var") in one page ( using session_start()
> > at the beginning), i don't get anything on the next page if i do echo
> > $the_var .
>
> Did you set your $the_var?
>
> Like:
>
> session_start();
> session_register('the_var');
>
> $the_var="is this the problem?";
>
> - --
>
> Nick Wilson
>
> Tel:+45 3325 0688
> Fax:+45 3325 0677
> Web:www.explodingnet.com
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.0.6 (GNU/Linux)
>
> iD8DBQE8ZCj4HpvrrTa6L5oRAoQJAJ91jzJYx0KV9Su+8/aJuoIURDNEYACeINDf
> StxfV0PhCeYfeGNWM17XFOM=
> =1Rrm
> -END PGP SIGNATURE-

--
Cristián Cerda Pé
[EMAIL PROTECTED]

Impulsando Ltda.
www.impulsando.com
San Pio X 2460  of.604
Providencia - Santiago
Tel: (56 2) 3358978



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] session register!!

2002-02-08 Thread Erik Price


On Friday, February 8, 2002, at 02:15  PM, Cristian Cerda wrote:

> I did set register_globals to On on the php.ini file. But when i use for
> example session_register("the_var") in one page ( using session_start()
> at the beginning), i don't get anything on the next page if i do echo
> $the_var .

I could be wrong about this: did you try restarting Apache?  e.g., 
"apachectl graceful" ?


Erik




Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] session register!!

2002-02-08 Thread Cristian Cerda

yes, and didn't work.

Erik Price wrote:

> On Friday, February 8, 2002, at 02:15  PM, Cristian Cerda wrote:
>
> > I did set register_globals to On on the php.ini file. But when i use for
> > example session_register("the_var") in one page ( using session_start()
> > at the beginning), i don't get anything on the next page if i do echo
> > $the_var .
>
> I could be wrong about this: did you try restarting Apache?  e.g.,
> "apachectl graceful" ?
>
> Erik
>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] session register!!

2002-02-08 Thread Janet Valade

Did you use session_start() on the second page?

In other words, the first page should have

session_start();
session_register("the_var");
$the_var=-"here it is";
link or whatever takes you to the second page.

Then the second page needs

session_start();
echo "$the_var";

Janet

- Original Message - 
From: "Cristian Cerda" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 08, 2002 11:15 AM
Subject: [PHP] session register!!


> Hi there, hope you can help me with my problem.
> 
> I'm trying to set up a PHP/MySQL web site using session variables to
> pass information between pages. So far no good.
> 
> I did set register_globals to On on the php.ini file. But when i use for
> example session_register("the_var") in one page ( using session_start()
> at the beginning), i don't get anything on the next page if i do echo
> $the_var .
> 
> Don't know what's wrong, but my guess is i have something wrong with the
> configuration as i copy/pasted most of the code.
> 
> I'm using OS X / WebSTAR V / PHP 4.0.6 as a CGI / MySQL
> 
> please help
> 
> Cristian
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] session problem

2002-02-14 Thread Andrey Hristov

What do you mean : "session persist"?
Whe you close the browser the file(the most common case) is not deleted till the 
session expires.
So if the expire time is 30 min it will stay in the /tmp for minimum 30 mins(the 
session garbage collector is not started on
every request). The cookie which is the session_id(PHPSESSID) is set to be valid till 
the browser is closed. After browser closing
it is no valid for the browser.


Best regards,
Andre Hristov

P.S.
Back from the exams hell...Ready for helping again.
- Original Message - 
From: "Rodrigo Peres" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Thursday, February 14, 2002 7:25 PM
Subject: [PHP] session problem


> Hi list,
> 
> I've made this script in order to solve the problem with reload button that
> I've posted. My idea is to register in a session the id, them check if it
> exists, if so don't insert again. But even if I quit the browser the session
> persists. Why?? ps: this is an include in the main page where I use
> session_start();
> 
> if(!$visita) {
> $visita = array();
> }
> if(!in_array($celebID,$visita)) {
> $sql_log = "INSERT INTO log_hits
> (logID,log_date,log_ip,log_referrer,log_celeb,log_url)
> VALUES('',now(),'$REMOTE_ADDR','$HTTP_REFERER','$celebID','$REQUEST_URI')";
> $query_log = new Query($conexao);
> $query_log->executa($sql_log);
> array_push($visita,$celebID);
> session_register('visita');
> }
> 
> Thank's
> 
> Rodrigo
> -- 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] session/cookies

2002-03-01 Thread Johnson, Kirk

Start by adding a "session_start()" to the 2nd file, then see what happens.

Kirk

> Hi again, I am doing a simple example of cookies and my 
> server seems to
> get frozen.
> 
> Basically, what I do is:
> 
> file01.php:
>   session_start();
>  seession_register("sess_var");
>  sess_var = "Hello";
> ?>
> 
> file02.php
>   echo $sess_var;
>  session_unregister("sess_var");
> ?>
> 
> What ends up happening when I go to the second file is the server just
> opens the file forever never showing the content, and ends up 
> giving me
> an error message.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] session problems

2002-03-14 Thread Erik Price


On Thursday, March 14, 2002, at 02:15  PM, Daniel Ferreira Castro wrote:

> If it validates the user, then he creates a session called 
> login_session and
> open another file called s_proj.htm throug the line
> header("location:http://pinguim/pb/s_proj.php";);
>
> The problem is
> on my login.php I have the block
>
> session_name("login_session");
> session_start();
> session_register(login);
> session_register(pass);
> $HTTP_SESSION_VARS["login"]= '$user';
> $HTTP_SESSION_VARS["pass"]='$pass';
> mysql_close($link);
> header("location:http://pinguim/pb/s_proj.php";);
>
> and I wish to retrieve at s_proj.php the values of the session variables
> login and pass registered for my "login_session" session.  How can I do 
> it?

Two things:

(1) at the top you say "s_proj.htm" but I am assuming this is a typo and 
you mean "s_proj.php"
(2) you have variables in single quotes, which will prevent them from 
expanding.  You can drop the single quotes if you want.
(3) If you are using PHP 4.1.0 or greater, then there is a much easier 
way to write this script:

session_start();
$_SESSION['login'] = $_POST['user']; // use $_GET if that is the method 
you're using
$_SESSION['pass'] = $_POST['pass']; // use $_GET if you are using that 
method
mysql_close($link);
header("location: http://pinguim/pb/s_proj.php";);



HTH,
Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] SESSION PROBLEM

2002-03-19 Thread Erik Price


On Tuesday, March 19, 2002, at 02:56  PM, karthikeyan wrote:

> What does this error means
>
> -
> Warning: Cannot send session cookie - headers already sent by (output
> started at /home/web/public_html/karthik1.php:7) in
> /home/web/public_html/karthik1.php on line 35
>
> Warning: Cannot send session cache limiter - headers already sent
> (output started at /home/web/public_html/karthik1.php:7) in
> /home/web/public_html/karthik1.php on line 35

Are you trying to start a session after the headers have already been 
sent?  Usually this happens on accident if you have some HTML whitespace 
being sent on accident (an extra line in an .inc file, or an extra line 
before the http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Session Variables

2002-03-25 Thread Rick Emery

it means you've already output some HTML or a blank line


-Original Message-
From: Chad Gilmer [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 12:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Session Variables


Hi There,

I am a beginner to PHP and I am tring to use session variables on my site.

I am trying to use Session Variables in PHP on the iPLANIT.tv site

When I use the following code:



I get the following error

Warning: Cannot send session cookie - headers already sent by (output
started at /home/iplanit/public_html/php/login.php:8) in
/home/iplanit/public_html/php/login.php on line 11

Warning: Cannot send session cache limiter - headers already sent (output
started at /home/iplanit/public_html/php/login.php:8) in
/home/iplanit/public_html/php/login.php on line 11

Any Ideas???

Cheers

Chad



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] session variables

2002-04-04 Thread Wolfram Kriesing

On Thursday 04 April 2002 19:15, Lee, Ford wrote:
> I seem to have configuration problemsi just can't seem to get
> session variables written to in files under win2000, NTFS w/ Apache and
> PHP..i've already done everything from session_start() on every page
> to making var globalanybody can help??  thanksbtw, i got the
> same system on a Linux box running apache and php and it works fine

this is a bug in PHP 4.1.2 on win
   http://bugs.php.net/?id=16423
i am also looking for a workaround  :-(
-- 
Wolfram

... translating template engine 
  http://sf.net/projects/simpletpl

... authentication system 
  http://sf.net/projects/auth

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] session variables

2002-04-04 Thread Lee, Ford

I've even tried the new php4apache.dll that was on that bug list and
still did not work.  I'm suprised nobody else has this session problem
on Windows 2000 and Apache...

-Original Message-
From: Wolfram Kriesing [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 12:21 PM
To: Lee, Ford; [EMAIL PROTECTED]
Subject: Re: [PHP] session variables


On Thursday 04 April 2002 19:15, Lee, Ford wrote:
> I seem to have configuration problemsi just can't seem to get
> session variables written to in files under win2000, NTFS w/ Apache
and
> PHP..i've already done everything from session_start() on every
page
> to making var globalanybody can help??  thanksbtw, i got the
> same system on a Linux box running apache and php and it works
fine

this is a bug in PHP 4.1.2 on win
   http://bugs.php.net/?id=16423
i am also looking for a workaround  :-(
-- 
Wolfram

... translating template engine 
  http://sf.net/projects/simpletpl

... authentication system 
  http://sf.net/projects/auth


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] session variables

2002-04-04 Thread Lee, Ford

Apparently under the bug report database for bug number 16043, my
exactly problem was described.  According to the PHP team, this
windows/apache1.3.23/php4.1.2 session not writing to file bug has been
fixed in the 4.2.0RC1 binaries.  I've patched my php4apache.dll with the
ones from 4.2.0RC1 AND it still doesn't work!!!  Anyone who used
4.2.0RC1 came across this problem and made it work?


-Original Message-
From: SHEETS,JASON (Non-HP-Boise,ex1) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 12:43 PM
To: Lee, Ford
Subject: RE: [PHP] session variables


This isn't limited to windows 2000, I've seen it on nt and xp as well.
I
believe it is just a php on windows bug in general.  I've heard 4.1.1
was
not broken however 4.1.1 has a security hole, if you are just using
windows
as a test/development platform you may consider trying 4.1.1.

Jason

-Original Message-
From: Lee, Ford [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 10:33 AM
To: Wolfram Kriesing
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] session variables


I've even tried the new php4apache.dll that was on that bug list and
still did not work.  I'm suprised nobody else has this session problem
on Windows 2000 and Apache...

-Original Message-
From: Wolfram Kriesing [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 12:21 PM
To: Lee, Ford; [EMAIL PROTECTED]
Subject: Re: [PHP] session variables


On Thursday 04 April 2002 19:15, Lee, Ford wrote:
> I seem to have configuration problemsi just can't seem to get
> session variables written to in files under win2000, NTFS w/ Apache
and
> PHP..i've already done everything from session_start() on every
page
> to making var globalanybody can help??  thanksbtw, i got the
> same system on a Linux box running apache and php and it works
fine

this is a bug in PHP 4.1.2 on win
   http://bugs.php.net/?id=16423
i am also looking for a workaround  :-(
-- 
Wolfram

... translating template engine 
  http://sf.net/projects/simpletpl

... authentication system 
  http://sf.net/projects/auth


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] session variables

2002-04-04 Thread heinisch

At 04.04.2002  13:18, you wrote:
>Apparently under the bug report database for bug number 16043, my
>exactly problem was described.  According to the PHP team, this
>windows/apache1.3.23/php4.1.2 session not writing to file bug has been
>fixed in the 4.2.0RC1 binaries.  I've patched my php4apache.dll with the
>ones from 4.2.0RC1 AND it still doesn't work!!!  Anyone who used
>4.2.0RC1 came across this problem and made it work?


>This isn't limited to windows 2000, I've seen it on nt and xp as well.
>I
>believe it is just a php on windows bug in general.  I've heard 4.1.1
>was
>not broken however 4.1.1 has a security hole, if you are just using
>windows
>as a test/development platform you may consider trying 4.1.1.


You´re on the wrong list, windowsPHPuser is the right one!
This is php-general.
HTH Oliver


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Session problem

2002-04-15 Thread Nick Winfield

On Mon, 15 Apr 2002, Torkil Johnsen wrote:

> I get this errormessage when trying to make my logon work:
>
> Warning: Cannot send session cache limiter - headers already sent
> (output started at /path/to/my/little/session.inc:9) in
> /path/to/my/little/session.inc on line 10
>
> line 10 contains: session_start();

Put session_start(); at the very top of your script - make sure there is
no whitespace at the top as well.

Cheers,

Nick Winfield.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Session problem

2002-04-15 Thread Janet Valade

The message means that that your script produced some output before the
session_start. You have to use session_start before any output. The message
shows where the output was started (line 9 of the given file).  Sometimes
output is started accidentally by having a blank space before your 
To: <[EMAIL PROTECTED]>
Sent: Monday, April 15, 2002 2:07 AM
Subject: [PHP] Session problem


> I get this errormessage when trying to make my logon work:
>
> Warning: Cannot send session cache limiter - headers already sent
> (output started at /path/to/my/little/session.inc:9) in
> /path/to/my/little/session.inc on line 10
>
> line 10 contains: session_start();
>
>
> It does however seem like I am "logged in", becase at the bottom of my
page,
> my logout button is appearing. (which it is only supposed to do if
> "session_is_registered(session_id)"
>
> When clickign the logout button I get this message:
> Warning: Trying to destroy uninitialized session in
> /path/to/my/little/session.inc on line 37
>
> Where line 37 says:session_destroy();
>
> Anyone...?
> Anyone have any links to any really good php session examples? I have read
> quite a few of them now...
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Session Variables

2002-04-16 Thread .ben

I have a function that i call at the beginning of each page (well, those
that require user auth).

checkLogin()

this checks for a positive integer value in a session variable called
intUserID

$_SESSION['intUserID'];

is that isn't a positive integer, i redirect to the login page.

the login is split into two script, prompt and process.  prompt is a form
which  POSTs data to the process script which in turn verifys the
username/password and if valid, assigns $_SESSION['intUserID'] the value of
the users user ID.

all looks fine to me.

 .b

p.s. is it just me or is the reply-to on this list a little odd?

> -Original Message-
> From: Phil Powell [mailto:[EMAIL PROTECTED]]
> Sent: 16 April 2002 22:50
> To: [EMAIL PROTECTED]
> Subject: [PHP] Session Variables
>
>
> I understand the concept of session variables, so I want to know the best
> methodology of approaching this:
>
> 1) HTML redirect to PHP page
> 2) PHP page looks for session
>   a) If found, show some stuff
>   b) If not found, prompt user for username and password
> 3) If no session, prompt user for username and password, once entered & is
> ok, set session and redirect
>
> Following is a code snippet I borrowed that I think would work, correct me
> if I'm wrong:
>
> // Setting a name for our session.
> session_name("hasLoggedIn");
> // Starting Session.
> session_start();
> // Register vars into session
> session_register("username");
> // Setting values for session vars.
> $HTTP_SESSION_VARS["username"]=$HTTP_POST_VARS["username"];
> // Referring a session info to another PHP.
> echo "text";
>
> Thanx!!
> Phil
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Session Tutorial

2002-04-22 Thread Ornella Fasolo

Hi,

I got a good start-tutorial from www.onlamp.com
the complete URL is 
http://www.onlamp.com/pub/a/php/excerpt/webdbapps_8/index.html?page=2
if you had some problem, you can write me, so I could send you it as an
attached file

i found it very good

regards
Ornella


>Recently I have been trying to work with sessions however I must admit that
>I am not sure I completely understand them. Does anyone know of a good
>tutorial that thoroughly explains sessions?
>
>Thanks in advance
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] session expiry

2002-05-01 Thread John Holmes

That's not what a session if for. You'll have to set your own cookie to
remember who the person is, and start a new session for them when they
return.

---John Holmes...

> -Original Message-
> From: Justin French [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 01, 2002 4:58 AM
> To: php
> Subject: [PHP] session expiry
> 
> Hi all,
> 
> I'm a little confused after reading some of the user notes on the
session
> pages in the manual.
> 
> I have a perfectly functioning script which i'm happy with which is
> managing
> all my sessions.  However, the sessions ends when the browser is
closed
> (or
> they log out).
> 
> I wish to modify the login form so that they can say "remember me" or
> "don't
> remember me" pull-down.
> 
> So, I need to know what to do in my session to have the session cookie
> last
> longer (say 30 days???).
> 
> I thought it might be something like:
> 
>  $expireTime = 60*60*24*30; // 30 days
> session_set_cookie_params($expireTime);
> session_start();
> ?>
> 
> or (last two lines swapped):
> 
>  $expireTime = 60*60*24*30; // 30 days
> session_start();
> session_set_cookie_params($expireTime);
> ?>
> 
> But it doesn't seem to be working.  Any ideas?
> 
> 
> Justin French
> 
> Creative Director
> http://Indent.com.au
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] session problems...

2002-05-13 Thread 1LT John W. Holmes

In addition to what Kevin said:

$_SESSION and $_session are not the same variables.

Use quotes in your session_register(), too: session_register("u_name"),
although you don't need session_register() at all, if you are using
$_SESSION['u_name'] = "value"; syntax.

---John Holmes...

> > Ok I think I am a little confused as to if this is working or not:  I
have
> > commented in the places where I am confused... if someone could please
> point
> > out why the variables "u_name & p_word" are not being registered that
> would
> > help me out a ton... thanks in advance,
> > Jas
> > --- Form to log user in ---
> > 
> >   
> >   
> >   
> > 
> > --- checks db to see if user exists ---
> >  > if ((!$u_name) || (!$p_word)) {
> >  header ("Location: index.php");
> >  exit;
> >  }
> >  $db_name = "bignicke";
> >  $table_name = "auth_users";
> >  $connection = @mysql_connect("localhost","user","password") or
die("Could
> > not connect to Database, please try again later");
> >  $db = @mysql_select_db($db_name, $connection) or die("Could not select
> > Database, please try again later");
> >  $sql = "SELECT * from $table_name WHERE un = \"$u_name\" AND pw =
> > password(\"$p_word\")";
> >  $result = @mysql_query($sql,$connection) or die("Couldn't execute
> query");
> >  $num = mysql_numrows($result);
> >  if ($num !=0) {
> >  $msg = "You have been authorized to make changes
to
> > the web site.";
> >  session_start();
> >  #session_register(u_name);  //cant tell if this has been registered
with
> a
> > print statement
> >  #session_register(p_word);  //can't tell if this is either
> >  $_session['u_name'] = $u_name; //this must be wrong too
> >  $_session['p_word'] = $p_word; //still wont register session variables
> >  } else {
> >  header ('Location: index.php');
> >  exit;
> >  }
> > ?>
> > 
> >  > echo $msg;
> > print (SESSION_ID());  // the session is working right here
> > print ($_SESSION['u_name']); // this will not print the registered
> variable
> > print ($_SESSION['p_word']);  // this is not printing the registered
> > variable either
> > print ($u_name);  // this works
> > print ($p_word);  // this works
> > print (session_is_registered('u_name'));  // this won't work
> > print (session_is_registered('p_word'));   // this isnt working either
> > ?>
> > 
> > edit more pages
> > 
> > --- page to see if variables are being passed to edit page ---
> >  > session_start();
> > $_session['u_name'] = $u_name; //should be registering username
> > $_session['p_word'] = $p_word; //should be registering password
> > ?>
> > 
> > success?
> >  > print ($_SESSION['u_name']); //does not print the variables
> > print ($_SESSION['p_word']); //this doesn't either
> > print (session_is_registered('u_name')); //this says variables are set
> > print (session_is_registered('p_word')); //this also says variables are
> set
> > ?>
> > 
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Session question

2002-05-25 Thread John Holmes

Just be sure you call session_start() on any page you want to access
session variables. 

Then you can set a variable by doing

$_SESSION["myvariable"] = "hello";

and then you can use $_SESSION["myvariable"] anywhere you want. 

This assumes the latest version of PHP. The procedure is similar on
older versions, you just have to use session_register().

---John Holmes...

> -Original Message-
> From: Christian Ista [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 25, 2002 4:45 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Session question
> 
> Hello,
> 
> I'm a newbie in PHP, I use a lot ColdFusion (at work).
> 
> With ColdFusion, it's very easy to create and use session variable. I
do
> something like that :
>  and this variable can be use
> everywhere.
> 
> Could you tell me how that's work in PHP. I saw in help file
> session.start.
> But it's not very clear for me.
> 
> Thanks for your help,
> 
> Bye
> 
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Session question

2002-05-25 Thread Christian Ista


> Just be sure you call session_start() on any page you want to access
> session variables.
>

I have to call this function on each page I use session variable or juste
once ?

> This assumes the latest version of PHP. The procedure is similar on
> older versions, you just have to use session_register().

>From wich version session_start() is include ?

Bye



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Session question

2002-05-25 Thread Jens Lehmann

> > Just be sure you call session_start() on any page you want to access
> > session variables.
> >
>
> I have to call this function on each page I use session variable or juste
> once ?

The statement is pretty clear. You've to call it once on each page you want
to access session variables.

>
> > This assumes the latest version of PHP. The procedure is similar on
> > older versions, you just have to use session_register().
>
> From wich version session_start() is include ?

Don't know what you want, but session_start() is part of PHP since version
4.0

Jens




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] session problems....

2002-06-14 Thread SenthilVelavan

-Rick
Change the owner and group of the directory to nobody.nobody to your /tmp
directory.Iam not sure here.
regards,
SenthilVelavan.P

- Original Message -
From: "php" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 15, 2002 7:42 AM
Subject: [PHP] session problems


> Anyone know why php would complain about not having permission to write
> the session file in /tmp (and to check the session.save_path var in my
> php.ini file. when it does specify /tmp in the php.ini and /tmp has
> drwxrwxrwt for permissions?
>
> I need a resolution... even if we have to pay for it... so if anyone
> feels they are good enough to fix this we can compensate you for your
> time.
>
> Thanks,
> Rick
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] session problems....

2002-06-14 Thread Bruce Karstedt

You should not be writing to /tmp that is a system directory. php.ini is a
file. If you need a "temporary" directory, use ./tmp that will be directory
in your web root directory.

Bruce Karstedt
President
Technology Consulting Associates, Ltd.
Tel: 847-735-9488
Fax: 847-735-9474


-Original Message-
From: php [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 9:12 PM
To: [EMAIL PROTECTED]
Subject: [PHP] session problems


Anyone know why php would complain about not having permission to write
the session file in /tmp (and to check the session.save_path var in my
php.ini file. when it does specify /tmp in the php.ini and /tmp has
drwxrwxrwt for permissions?

I need a resolution... even if we have to pay for it... so if anyone
feels they are good enough to fix this we can compensate you for your
time.

Thanks,
Rick

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] session problems....

2002-06-14 Thread Chris Shiflett

I'm not sure what sysadmins you are talking about, but /tmp is typically 
a world-writable directory.

Also, there is no such "strict" Unix naming convention. The directory 
/tmp is always /tmp, so matter how "lenient" you want to be. There is 
simply a difference between relative paths and absolute paths.

Chris

Bruce Karstedt wrote:

>I was referring to strict Unix directory naming conventions. /tmp is the
>equivalent of root/tmp and no sysadmin wants you writing to his /tmp
>directory. In fact you should not be allowed to write to /tmp. While I have
>not checked this, I have the feeling that PHP takes care of this for you. If
>you are creating a subdirectory, say for data, on your web site the Unix
>path may be something like /websites/yoursitename/htdocs/subdirectory.
>
>Since your default directory would be /websites/yoursitename/htdocs to get
>to /websites/yoursitename/htdocs/subdirectory you should use ./subdirectory
>which means "start in my default directory and go down one level to
>subdirectory.
>
>I'm sorry if this sounds critical, but I have found that many of the problem
>posted to this list are OS based, and I urge the members to learn both the
>operating system that they do their development on and the box where your
>site is hosted. The use of OS standard directories such as /tmp or /etc are
>bad form in Unix and make error log analysis difficult at best
>
>Bruce Karstedt
>President
>Technology Consulting Associates, Ltd.
>Tel: 847-735-9488
>Fax: 847-735-9474
>
>
>-Original Message-
>From: Julie Meloni [mailto:[EMAIL PROTECTED]]
>Sent: Friday, June 14, 2002 10:13 PM
>To: Bruce Karstedt
>Cc: 'php'; [EMAIL PROTECTED]
>Subject: Re[2]: [PHP] session problems
>
>
>BK> You should not be writing to /tmp that is a system directory. php.ini is
>a
>BK> file. If you need a "temporary" directory, use ./tmp that will be
>directory
>BK> in your web root directory.
>
>
>With all due respect, I think there's a reason that /tmp is the default
>session.save_path value in php.ini.  /tmp is temp.  It's where
>temporary things go.
>
>Saying "you shouldn't use that" is pretty much saying "Hey PHP
>Development Group, you've done this wrong for 2 years".  If you don't
>want to write your session files to /tmp, then don't.  But please
>don't say that it's wrong to do so.  That's not the answer to the
>guy's particular problem.
>
>
>- Julie
>
>--> Julie Meloni
>--> [EMAIL PROTECTED]
>--> www.thickbook.com
>
>Find "Sams Teach Yourself MySQL in 24 Hours" at
>http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20
>
>
>  
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Session Events

2002-06-26 Thread Al Baker

Well, since HTTP is stateless you can really say that this event happens
in either of two places:
- The next page accessed by the user with that session ID
- As an event in the backend.

If it's the first, I would recommend just having a lib_session that
verifies a timer or whatever and then redirects the page or whatever.

If it's something in the back-end, like a user accesses a page and you
need to do clean up 30 minutes after that user goes inactive, then I
recommend that is done in like a database stored procedure.



On Mon, 2002-06-24 at 20:37, Joe Krause wrote:
> Is there anyway to have PHP execute a function or object method
> automatically when a session is expired? In JAVA, you can define an
> httpSessionBindingEvent which will notify an object when it is bound to or
> unbound from a session. This may be the result of a servlet programmer
> explicitly unbinding an attribute from a session, due to a session being
> invalidated, or due to a session timing out. I need this behavior in PHP.
> 
> Joe Krause
> 
> 
> 
> 
-- 
This email was sent with Ximian Evolution.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Session variables

2002-07-08 Thread Rudolf Visagie

Generate a select structure dynamically with PHP, something like this:

";
for ($i = 0; $i <= count($OptionValue) - 1; $i++) {
if ($SelectedValue != "" && $OptionValue[$i] ==
$SelectedValue) {
echo "".$Option[$i]."";
} else {
echo "".$Option[$i]."";
}
}
echo "";
return 0;
}
?>


Untitled Document










Untitled Document





";
GenerateSelect ("MyList", $OptionValue, $Option, $MyList)
?>






Regards

Rudolf Visagie
Principal Software Developer
Digital Healthcare Solutions

Tel: 011 2655478
Cell: 082 895 1598
 

-Original Message-
From: Steve Fitzgerald [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 08, 2002 1:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Session variables


I am designing a form using sessions in which the user inputs their
details on page 1 and after submitting they are directed to page 2 for
confirmation. They then have the option of editing their input (ie they
are returned to page 1) where their previous input is reflected in the
form fields by
value =''
This works fine except if the input type is a drop down box, in which
case the default  is shown. Is there any way around this? How
can I show the user their previous choice in these boxes?
Any insights would be appreciated.
Steve


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Session variables

2002-07-08 Thread Justin French


>
>
>
>
>
>


Obviously this is labourios to code... you can do this a lot smarter/quicker
with an array for the entire select box... have an array of days, and do a
foreach loop which writes the all the options for you, with the if
statements, etc etc.

By the way, this has nothing to do with sessions :)

It's purely about how to populate drop-down menus from an array, and how to
have the correct value selected if it exists, else showing a default
selection.

Cheers,

Justin French



on 08/07/02 9:36 PM, Steve Fitzgerald ([EMAIL PROTECTED]) wrote:

> I am designing a form using sessions in which the user inputs their
> details on page 1 and after submitting they are directed to page 2 for
> confirmation. They then have the option of editing their input (ie they
> are returned to page 1) where their previous input is reflected in the
> form fields by
> value =''
> This works fine except if the input type is a drop down box, in which
> case the default  is shown. Is there any way around this? How
> can I show the user their previous choice in these boxes?
> Any insights would be appreciated.
> Steve
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Session variables

2002-07-08 Thread Steve Fitzgerald

Thanks Justin, your solution is spot-on!
Regards
Steve

Justin French wrote:

> 
>  ?>>
> >
>  ?>>
>  } ?>>
>  ?>>
> >
> 
>
> Obviously this is labourios to code... you can do this a lot smarter/quicker
> with an array for the entire select box... have an array of days, and do a
> foreach loop which writes the all the options for you, with the if
> statements, etc etc.
>
> By the way, this has nothing to do with sessions :)
>
> It's purely about how to populate drop-down menus from an array, and how to
> have the correct value selected if it exists, else showing a default
> selection.
>
> Cheers,
>
> Justin French
>
> on 08/07/02 9:36 PM, Steve Fitzgerald ([EMAIL PROTECTED]) wrote:
>
> > I am designing a form using sessions in which the user inputs their
> > details on page 1 and after submitting they are directed to page 2 for
> > confirmation. They then have the option of editing their input (ie they
> > are returned to page 1) where their previous input is reflected in the
> > form fields by
> > value =''
> > This works fine except if the input type is a drop down box, in which
> > case the default  is shown. Is there any way around this? How
> > can I show the user their previous choice in these boxes?
> > Any insights would be appreciated.
> > Steve
> >


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] session problem

2002-07-08 Thread Naintara Jain

Just thought I'd mail it here.
It's a reported bug, Bug #16263.
Discovered (after hours of agonizing).

martin, values were being assigned and passed :) thanks anyway.


-Original Message-
From: Martin Clifford [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 08, 2002 6:29 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] session problem


You have to set the variables before using session_register().



If you try registering a variable that has no value, then of course no value
can be carried over to the next page. :o)

Martin

>>> "Naintara Jain" <[EMAIL PROTECTED]> 07/06/02 09:08PM >>>
I am storing some values in session variables.
The behavior of the session is pretty unpredictable.

On the first page I begin with:
session_name("aname")
session_start()
session_register("var1","var2")

In another page I check for existing value of session variable "var2".
In the next page I have the following code:
session_name("aname")
session_start()

if(($var2)=="" || !isset($var2))
"invalid"

But the strange thing is that the session value is not accessible in the
other page.

I have tried passing the session id though session_id() in the URL.

Session handling has been giving me some trouble (windows 2000, IIS)
The strange thing is that it works some times.

Can anyone give any pointers?



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Session problem

2001-11-16 Thread Daniel Alsén

Nope. That is just the problem. session_destroy() only destroys the data
inside the session. Not the id.

But i actually solved it now. I am using the same algorithm as php itself to
create a new id everytime the page is loaded:

   session_id( md5( uniqid( "", 1 ) ) );
   session_start();

- Daniel

> -Original Message-
> From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED]]
> Sent: den 16 november 2001 15:40
> To: Daniel Alsén
> Subject: Re: [PHP] Session problem
>
>
> I think you can set a new session id using session_start()
> so if you need a new id just destroy the old one using session_destroy()
> then call sessio_start(your new id)  and that should work fine now.
>
> - Original Message -
> From: "Daniel Alsén" <[EMAIL PROTECTED]>
> To: "PHP" <[EMAIL PROTECTED]>
> Sent: Friday, November 16, 2001 9:05 AM
> Subject: [PHP] Session problem
>
>
> > Hi,
> >
> > i am writing a simple postcard-script. I use php 4 sessions and
> stores the
> > data in MySql with the sessionid as a unique id for the card.
> >
> > The problem is - i can´t send more than one card with the same
> id. I can´t
> > find any way to get a new session id without closing the browser. In the
> > manual there only seems to be functions to unset or unregister
> the actual
> > data inside the session - not the id itself.
> >
> > Any ideas?
> >
> > Regards
> > # Daniel Alsén| www.mindbash.com #
> > # [EMAIL PROTECTED]  | +46 704 86 14 92 #
> > # ICQ: 63006462   |  #
> >
> >
> > --
> > 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]




Re: [PHP] Session Help

2001-11-30 Thread Papp Gyozo


PHP automatically calls the appropiate function instead if you.
But consider that the save handler is not called on individual 
session_register functions, only when all output is gone, and 
the whole session - each registered variable - must be saved.


Note: The "write" handler is not executed until after the output stream is closed. 
Thus, output from debugging statements in the "write" handler will never be seen in 
the browser. If debugging output is necessary, it is suggested that the debug output 
be written to a file instead. 


- Original Message - 
From: "phantom" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 30, 2001 10:10 AM
Subject: [PHP] Session Help


| I am trying to set my session data to be stored in MySQL so I am using
| session_set_save_handler() which sets the six user-level session storage
| functions (which I have already defined).
| 
| Will session_set_save_handler automatically run the appropiate storage
| function when required (like when i say session_register("Variable"))
| --OR-- do I specifically have to run that function
| (mysql_sessions_write(SID,$Value))  from my script when I want to save
| info to the session table?
| 
| I would appreciate any scripts anyone might have that would illustrate
| how this works, the PHP manual and online examples I have found just are
| not cutting it.
| 
| Thank you.  [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]
| 



Re: [PHP] session woes

2001-12-12 Thread Andrey Hristov

Is register_globals turned on or off?


- Original Message - 
From: "Gaylen Fraley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 09, 2001 6:13 AM
Subject: [PHP] session woes


> I have a friend who is using an ISP that uses php4.0.3pl1 .  It appears that
> session_register is not working between pages.  In script A, the session var
> gets registered and shows registered using session_is_registered('testvar');
> However, when script B is called, a session-start is issued and testvar is
> not registered.  Running the identical code, but not with his ISP, under
> 4.06, it works perfectly.  Are there known issues?
> 
> --
> Gaylen
> [EMAIL PROTECTED]
> Home http://www.gaylenandmargie.com
> PHP KISGB v2.5 Guest Book http://www.gaylenandmargie.com/phpwebsite
> 
> 
> 
> 
> -- 
> 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]




Re: [PHP] Session troubles

2001-12-29 Thread Miles Thompson

Sean,

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

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;

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()?

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.

-- 
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 David Jackson

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 ---


--- seaninc.php --





> 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]




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 ---
> 
> 
> --- seaninc.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 PROTECTE

Re: [PHP] Session troubles

2001-12-29 Thread David Jackson

Sean --
Do you get the same errors, with Netscape 4.x?


> 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 ---
>> 
>> 
>> --- seaninc.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 unpu

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 ---
> >> 
> >> 
> >> --- seaninc.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.

Re: [PHP] Session troubles

2001-12-29 Thread David Jackson

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

--- form.html ---

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://www.w3.org/1999/xhtml";>

  
  No title
  




  
  
  







--- form.php 

$Green";
echo "$Yellow";
echo "$Red";
echo "Verify that session_vars were 
passwd";
// Get out of here

?>

--- form02.php -
";
echo "";
echo "session_registers:";
echo "Green:$Green";
echo "Yellow:$Yellow";
echo "Red:$Red";
echo "";
?>




-- 
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 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 ---
> 
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> http://www.w3.org/1999/xhtml";>
> 
>   
>   No title
>   
> 
> 
> 
> 
>   
>   
>   
> 
> 
> 
> 
> 
> 
> 
> --- form.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 "$Green";
> echo "$Yellow";
> echo "$Red";
> echo "Verify that session_vars were 
> passwd";
> // Get out of here
> 
> ?>
> 
> --- form02.php -
>  session_start();
> // sessions  on 48 N. Random Rd.
> // basic echo of var from form
> echo "";
> echo "";
> echo "session_registers:";
> echo "Green:$Green";
> echo "Yellow:$Yellow";
> echo "Red:$Red";
> echo "";
> ?>
> 
> 
> 
> 
> -- 
> 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]




Re: [PHP] Session troubles

2001-12-29 Thread David Jackson

Sean --

Does you standard (non session) seem to work ok? Such as:
$stuff";
echo "$more_stuff";
echo "$still_more_stuff";
?>

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. 

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

-- David



-- 
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-30 Thread Sean LeBlanc

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

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-31 Thread Jaime Bozza

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.

Jaime Bozza

-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 ---
> 
> 
> --- seaninc.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 

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 ---
> > 
> > 
> > --- seaninc.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:
>

RE: [PHP] Session troubles

2002-01-02 Thread Jaime Bozza

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.

Jaime Bozza


-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 ---
> > 
> > 
> > --- seaninc.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

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 ---
> > > 
> > > 
> > > --- seaninc.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

RE: [PHP] Session troubles

2002-01-02 Thread Jaime Bozza

What do you have for the return values for your session_read function?
(Specifically, what do you return when there's no data available?)

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 ---
> > > 
> > > 
> > > --- seaninc.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();
> > 

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 ---
> > > > 
> > > > 
> > > > --- seaninc.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/ses

RE: [PHP] Session troubles

2002-01-02 Thread Jaime Bozza

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.


Jaime Bozza


-Original Message-
From: Sean LeBlanc [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 02, 2002 4:02 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Session troubles


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 ---
> > > > 
> > > > 
> > > > --- seaninc.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 
> &

RE: [PHP] Session troubles

2002-01-03 Thread Junior, Ricardo

Hi Sean !

I had the same problem... this can be resolved using the function
"session_write_close()" at the end of each script you use sessions. It will
force PHP to call the write and close function.

In some combinations of PHP version, Apache and OS, this problem doesn't
happens, but as you, I had this problem too.. :)

Put this function in yours PHP scripts and see if now them will work.

Here is an exemple of a test script:

 where is my session functions
declareted to use database...
session_start();
?>


MySQL Session Management: Second Page


" );
print( "SESSION Account: $aAccount" );
$aUser = "Katie";
$aAccount = "2026";
print( "CHANGED User: $aUser" );
print( "CHANGED Account: $aAccount" );
session_write_close();
?>



Cheers,
_
Ricardo J. A. Júnior, Software Engineer Trainee
Bowne Global Solutions

Phone   +55 21 2515 7713
[EMAIL PROTECTED]
www.bowneglobal.com.br

 -Original Message-
From:   Sean LeBlanc [mailto:[EMAIL PROTECTED]] 
Sent:   Wednesday, January 02, 2002 2:20 PM
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 ---
> > > 
> > > 
> > > --- seaninc.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 
> 

RE: [PHP] Session troubles

2002-01-03 Thread Jaime Bozza

Ricardo,
   I've had some strange problems with session writing, but they always
returned back to the fact that "return false" was being used in the
session read function.  PHP 4.0.6 wouldn't write out sessions when
register_globals was set to off when you were using "return false".  PHP
4.1.0 crashes with signal 11 after a bit when using "return false".
I've filed a couple of bug reports with the request that this be fixed.
I believe a patch is either being worked on or already submitted, but
I'm not positive.

   Sean's problem is that he's using "return false" in his session read
function.  The session read function should return a blank value ('')
and not false when there's no data.  This was never clear in the
documentation (and complaint I made) but is quite true.  Once switching
over to using ('') instead of (false), I no longer had problems.

Jaime Bozza


-Original Message-
From: Junior, Ricardo [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 03, 2002 8:52 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Session troubles


Hi Sean !

I had the same problem... this can be resolved using the function
"session_write_close()" at the end of each script you use sessions. It
will force PHP to call the write and close function.

In some combinations of PHP version, Apache and OS, this problem doesn't
happens, but as you, I had this problem too.. :)

Put this function in yours PHP scripts and see if now them will work.

Here is an exemple of a test script:

 where is my session
functions
declareted to use database...
session_start();
?>


MySQL Session Management: Second Page


" );
print( "SESSION Account: $aAccount" );
$aUser = "Katie";
$aAccount = "2026";
print( "CHANGED User: $aUser" );
print( "CHANGED Account: $aAccount" );
session_write_close();
?>



Cheers,
_
Ricardo J. A. Júnior, Software Engineer Trainee
Bowne Global Solutions

Phone   +55 21 2515 7713
[EMAIL PROTECTED]
www.bowneglobal.com.br

 -Original Message-
From:   Sean LeBlanc [mailto:[EMAIL PROTECTED]] 
Sent:   Wednesday, January 02, 2002 2:20 PM
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 ---
> > > 
> > > 
> > > --- seaninc.php --
> > >  > > session_start();
&g

RE: [PHP] Session troubles

2002-01-03 Thread Junior, Ricardo

Ok Jaime. I've imagine that he had the same problem that I have had before..
:)

I'm really returning a '"" in my read function when there is no data too...
because of this I don't had the problem related by Sean...

Thanks,
_
Ricardo J. A. Júnior, Software Engineer Trainee
Bowne Global Solutions

Phone   +55 21 2515 7713
[EMAIL PROTECTED]
www.bowneglobal.com.br

 -Original Message-
From:   Jaime Bozza [mailto:[EMAIL PROTECTED]] 
Sent:   Thursday, January 03, 2002 11:09 AM
To: [EMAIL PROTECTED]
Subject:RE: [PHP] Session troubles

Ricardo,
   I've had some strange problems with session writing, but they always
returned back to the fact that "return false" was being used in the
session read function.  PHP 4.0.6 wouldn't write out sessions when
register_globals was set to off when you were using "return false".  PHP
4.1.0 crashes with signal 11 after a bit when using "return false".
I've filed a couple of bug reports with the request that this be fixed.
I believe a patch is either being worked on or already submitted, but
I'm not positive.

   Sean's problem is that he's using "return false" in his session read
function.  The session read function should return a blank value ('')
and not false when there's no data.  This was never clear in the
documentation (and complaint I made) but is quite true.  Once switching
over to using ('') instead of (false), I no longer had problems.

Jaime Bozza


-Original Message-----
From: Junior, Ricardo [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 03, 2002 8:52 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Session troubles


Hi Sean !

I had the same problem... this can be resolved using the function
"session_write_close()" at the end of each script you use sessions. It
will force PHP to call the write and close function.

In some combinations of PHP version, Apache and OS, this problem doesn't
happens, but as you, I had this problem too.. :)

Put this function in yours PHP scripts and see if now them will work.

Here is an exemple of a test script:

 where is my session
functions
declareted to use database...
session_start();
?>


MySQL Session Management: Second Page


" );
print( "SESSION Account: $aAccount" );
$aUser = "Katie";
$aAccount = "2026";
print( "CHANGED User: $aUser" );
print( "CHANGED Account: $aAccount" );
session_write_close();
?>



Cheers,
_
Ricardo J. A. Júnior, Software Engineer Trainee
Bowne Global Solutions

Phone   +55 21 2515 7713
[EMAIL PROTECTED]
www.bowneglobal.com.br

 -Original Message-
From:   Sean LeBlanc [mailto:[EMAIL PROTECTED]] 
Sent:   Wednesday, January 02, 2002 2:20 PM
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, Decem

RE: [PHP] Session troubles

2002-01-03 Thread Jaime Bozza

Hmmm...  So, there are yet more problems with the session functions. :)


Are you using 4.1.1 or 4.0.6?  

Jaime


-Original Message-
From: Junior, Ricardo [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 03, 2002 9:34 AM
To: 'Jaime Bozza'; [EMAIL PROTECTED]
Subject: RE: [PHP] Session troubles


Ok Jaime. I've imagine that he had the same problem that I have had
before..
:)

I'm really returning a '"" in my read function when there is no data
too... because of this I don't had the problem related by Sean...

Thanks,
_
Ricardo J. A. Júnior, Software Engineer Trainee
Bowne Global Solutions

Phone   +55 21 2515 7713
[EMAIL PROTECTED]
www.bowneglobal.com.br

 -Original Message-
From:   Jaime Bozza [mailto:[EMAIL PROTECTED]] 
Sent:   Thursday, January 03, 2002 11:09 AM
To:     [EMAIL PROTECTED]
Subject:RE: [PHP] Session troubles

Ricardo,
   I've had some strange problems with session writing, but they always
returned back to the fact that "return false" was being used in the
session read function.  PHP 4.0.6 wouldn't write out sessions when
register_globals was set to off when you were using "return false".  PHP
4.1.0 crashes with signal 11 after a bit when using "return false". I've
filed a couple of bug reports with the request that this be fixed. I
believe a patch is either being worked on or already submitted, but I'm
not positive.

   Sean's problem is that he's using "return false" in his session read
function.  The session read function should return a blank value ('')
and not false when there's no data.  This was never clear in the
documentation (and complaint I made) but is quite true.  Once switching
over to using ('') instead of (false), I no longer had problems.

Jaime Bozza


-Original Message-----
From: Junior, Ricardo [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 03, 2002 8:52 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Session troubles


Hi Sean !

I had the same problem... this can be resolved using the function
"session_write_close()" at the end of each script you use sessions. It
will force PHP to call the write and close function.

In some combinations of PHP version, Apache and OS, this problem doesn't
happens, but as you, I had this problem too.. :)

Put this function in yours PHP scripts and see if now them will work.

Here is an exemple of a test script:

 where is my session
functions
declareted to use database...
session_start();
?>


MySQL Session Management: Second Page


" );
print( "SESSION Account: $aAccount" );
$aUser = "Katie";
$aAccount = "2026";
print( "CHANGED User: $aUser" );
print( "CHANGED Account: $aAccount" );
session_write_close();
?>



Cheers,
_
Ricardo J. A. Júnior, Software Engineer Trainee
Bowne Global Solutions

Phone   +55 21 2515 7713
[EMAIL PROTECTED]
www.bowneglobal.com.br

 -Original Message-
From:   Sean LeBlanc [mailto:[EMAIL PROTECTED]] 
Sent:   Wednesday, January 02, 2002 2:20 PM
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!
> 

RE: [PHP] Session troubles

2002-01-03 Thread Alok K. Dhir

FYI - I can confirm Jaime's assertion.  I too had the exact same issue
with the exact same fix.

> -Original Message-
> From: 
> [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED].
> net] On Behalf Of Jaime Bozza
> Sent: Thursday, January 03, 2002 9:09 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Session troubles
> 
> 
> Ricardo,
>I've had some strange problems with session writing, but 
> they always returned back to the fact that "return false" was 
> being used in the session read function.  PHP 4.0.6 wouldn't 
> write out sessions when register_globals was set to off when 
> you were using "return false".  PHP 4.1.0 crashes with signal 
> 11 after a bit when using "return false". I've filed a couple 
> of bug reports with the request that this be fixed. I believe 
> a patch is either being worked on or already submitted, but 
> I'm not positive.
> 
>Sean's problem is that he's using "return false" in his 
> session read function.  The session read function should 
> return a blank value ('') and not false when there's no data. 
>  This was never clear in the documentation (and complaint I 
> made) but is quite true.  Once switching over to using ('') 
> instead of (false), I no longer had problems.
> 
> Jaime Bozza
> 
> 
> -Original Message-
> From: Junior, Ricardo [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, January 03, 2002 8:52 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Session troubles
> 
> 
> Hi Sean !
> 
> I had the same problem... this can be resolved using the 
> function "session_write_close()" at the end of each script 
> you use sessions. It will force PHP to call the write and 
> close function.
> 
> In some combinations of PHP version, Apache and OS, this 
> problem doesn't happens, but as you, I had this problem too.. :)
> 
> Put this function in yours PHP scripts and see if now them will work.
> 
> Here is an exemple of a test script:
> 
>  error_reporting( E_ALL );
> ini_set("session.save_handler","user");
> include( "./mysession.php" );   > where is my session
> functions
> declareted to use database...
> session_start();
> ?>
> 
> 
>   MySQL Session Management: Second Page
> 
> 
>  print( "SESSION User: $aUser" );
> print( "SESSION Account: $aAccount" );
> $aUser = "Katie";
> $aAccount = "2026";
> print( "CHANGED User: $aUser" );
> print( "CHANGED Account: $aAccount" );
>     session_write_close();
> ?>
> 
> 
> 
> Cheers,
> _
> Ricardo J. A. Júnior, Software Engineer Trainee
> Bowne Global Solutions
> 
> Phone +55 21 2515 7713
> [EMAIL PROTECTED]
> www.bowneglobal.com.br
> 
>  -Original Message-
> From: Sean LeBlanc [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 02, 2002 2:20 PM
> 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 w

RE: [PHP] Session troubles

2002-01-03 Thread Junior, Ricardo

I was using 4.06 version... but I don't test this issues with 4.1 version in
my system (linux Mandrake 8.1)...
I will test and let you know! :)

_
Ricardo J. A. Júnior, Software Engineer Trainee
Bowne Global Solutions

Phone   +55 21 2515 7713
[EMAIL PROTECTED]
www.bowneglobal.com.br

 -Original Message-
From:   Jaime Bozza [mailto:[EMAIL PROTECTED]] 
Sent:   Thursday, January 03, 2002 11:38 AM
To: [EMAIL PROTECTED]
Subject:        RE: [PHP] Session troubles

Hmmm...  So, there are yet more problems with the session functions. :)


Are you using 4.1.1 or 4.0.6?  

Jaime


-Original Message-
From: Junior, Ricardo [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 03, 2002 9:34 AM
To: 'Jaime Bozza'; [EMAIL PROTECTED]
Subject: RE: [PHP] Session troubles


Ok Jaime. I've imagine that he had the same problem that I have had
before..
:)

I'm really returning a '"" in my read function when there is no data
too... because of this I don't had the problem related by Sean...

Thanks,
_
Ricardo J. A. Júnior, Software Engineer Trainee
Bowne Global Solutions

Phone   +55 21 2515 7713
[EMAIL PROTECTED]
www.bowneglobal.com.br

 -Original Message-
From:   Jaime Bozza [mailto:[EMAIL PROTECTED]] 
Sent:   Thursday, January 03, 2002 11:09 AM
To:     [EMAIL PROTECTED]
Subject:RE: [PHP] Session troubles

Ricardo,
   I've had some strange problems with session writing, but they always
returned back to the fact that "return false" was being used in the
session read function.  PHP 4.0.6 wouldn't write out sessions when
register_globals was set to off when you were using "return false".  PHP
4.1.0 crashes with signal 11 after a bit when using "return false". I've
filed a couple of bug reports with the request that this be fixed. I
believe a patch is either being worked on or already submitted, but I'm
not positive.

   Sean's problem is that he's using "return false" in his session read
function.  The session read function should return a blank value ('')
and not false when there's no data.  This was never clear in the
documentation (and complaint I made) but is quite true.  Once switching
over to using ('') instead of (false), I no longer had problems.

Jaime Bozza


-Original Message-
From: Junior, Ricardo [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 03, 2002 8:52 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Session troubles


Hi Sean !

I had the same problem... this can be resolved using the function
"session_write_close()" at the end of each script you use sessions. It
will force PHP to call the write and close function.

In some combinations of PHP version, Apache and OS, this problem doesn't
happens, but as you, I had this problem too.. :)

Put this function in yours PHP scripts and see if now them will work.

Here is an exemple of a test script:

 where is my session
functions
declareted to use database...
session_start();
?>


MySQL Session Management: Second Page


" );
print( "SESSION Account: $aAccount" );
$aUser = "Katie";
$aAccount = "2026";
print( "CHANGED User: $aUser" );
print( "CHANGED Account: $aAccount" );
session_write_close();
?>



Cheers,
_
Ricardo J. A. Júnior, Software Engineer Trainee
Bowne Global Solutions

Phone   +55 21 2515 7713
[EMAIL PROTECTED]
www.bowneglobal.com.br

 -Original Message-
From:   Sean LeBlanc [mailto:[EMAIL PROTECTED]] 
Sent:   Wednesday, January 02, 2002 2:20 PM
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 

RE: [PHP] Session troubles

2002-01-03 Thread Junior, Ricardo

This was problem that I had:  the function write was not been called by PHP
sessions functions when a script finish or when I change the variable
contents.

Searching on PHP.net I saw this solution there: add a call to function
"session_write_close()" at the end of the php code.

This should be another problem with Sessions functions... but I need to test
this with PHP 4.1...

Thanks,
_
Ricardo J. A. Júnior, Software Engineer Trainee
Bowne Global Solutions

Phone   +55 21 2515 7713
[EMAIL PROTECTED]
www.bowneglobal.com.br

 -Original Message-
From:   Alok K. Dhir [mailto:[EMAIL PROTECTED]] 
Sent:   Thursday, January 03, 2002 12:56 PM
To: 'Jaime Bozza'; [EMAIL PROTECTED]
Subject:    RE: [PHP] Session troubles

FYI - I can confirm Jaime's assertion.  I too had the exact same issue
with the exact same fix.

> -Original Message-
> From: 
> [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED].
> net] On Behalf Of Jaime Bozza
> Sent: Thursday, January 03, 2002 9:09 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Session troubles
> 
> 
> Ricardo,
>I've had some strange problems with session writing, but 
> they always returned back to the fact that "return false" was 
> being used in the session read function.  PHP 4.0.6 wouldn't 
> write out sessions when register_globals was set to off when 
> you were using "return false".  PHP 4.1.0 crashes with signal 
> 11 after a bit when using "return false". I've filed a couple 
> of bug reports with the request that this be fixed. I believe 
> a patch is either being worked on or already submitted, but 
> I'm not positive.
> 
>Sean's problem is that he's using "return false" in his 
> session read function.  The session read function should 
> return a blank value ('') and not false when there's no data. 
>  This was never clear in the documentation (and complaint I 
> made) but is quite true.  Once switching over to using ('') 
> instead of (false), I no longer had problems.
> 
> Jaime Bozza
> 
> 
> -Original Message-
> From: Junior, Ricardo [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, January 03, 2002 8:52 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Session troubles
> 
> 
> Hi Sean !
> 
> I had the same problem... this can be resolved using the 
> function "session_write_close()" at the end of each script 
> you use sessions. It will force PHP to call the write and 
> close function.
> 
> In some combinations of PHP version, Apache and OS, this 
> problem doesn't happens, but as you, I had this problem too.. :)
> 
> Put this function in yours PHP scripts and see if now them will work.
> 
> Here is an exemple of a test script:
> 
>  error_reporting( E_ALL );
> ini_set("session.save_handler","user");
> include( "./mysession.php" );   > where is my session
> functions
> declareted to use database...
> session_start();
> ?>
> 
> 
>   MySQL Session Management: Second Page
> 
> 
>  print( "SESSION User: $aUser" );
> print( "SESSION Account: $aAccount" );
> $aUser = "Katie";
> $aAccount = "2026";
> print( "CHANGED User: $aUser" );
> print( "CHANGED Account: $aAccount" );
> session_write_close();
> ?>
> 
> 
> 
> Cheers,
> _
> Ricardo J. A. Júnior, Software Engineer Trainee
> Bowne Global Solutions
> 
> Phone +55 21 2515 7713
> [EMAIL PROTECTED]
> www.bowneglobal.com.br
> 
>  -Original Message-
> From: Sean LeBlanc [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 02, 2002 2:20 PM
> 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
> > 

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 encode

2001-02-13 Thread Michael McGlothlin

You don't need to use session_encode () in most situations. You can use 
sessions and they'll automaticlly encode your variables. Is that what 
you wondered?

Peter Houchin wrote:

> With session incode do you have to have it on every page where you have a
> session_start() ?
> 
> Peter
> 



-- 
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 encode

2001-02-13 Thread Peter Houchin

Its sort of what i wondered when the session is started it makes a file
in say c:/temp (in NT machine) what i wondered is how do you encode the
information in there ... the info in the file is something like
user|s:6:"username";pass|s:6:"password";email|s:6:"email address";

and also i can't get a value for the email ...  so the
session_register('email') returns nothing ... do you have any ideas?

-Original Message-
From: Michael McGlothlin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 10:35 AM
To: Peter Houchin
Cc: PHP MAIL GROUP
Subject: Re: [PHP] session encode


You don't need to use session_encode () in most situations. You can use
sessions and they'll automaticlly encode your variables. Is that what
you wondered?

Peter Houchin wrote:

> With session incode do you have to have it on every page where you have a
> session_start() ?
>
> Peter
>




-- 
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 Questions...

2001-02-15 Thread Martin A. Marques

El Jue 15 Feb 2001 12:32, escribiste:
> I was reading through the documentation on sessions at
> http://www.php.net/manual/en/html/ref.session.html
>
> I have a few questions..
>
> 1) How do I explicitly close a session, so that any subsequent attempts to
> use pages would require a new session started? Will session_destroy() do
> this?

Yes.

> 2) I don't want to rely on cookies being set for the client's browser. 
> What are the security ramifications for passing the SID through the URL?

As secure as your server is.
But if you compiled php --with-trans-id, then you will have no problems at 
all.

> Most important to me is to understand the overall concept.  Can I start and
> stop sessions whever I want? Can I start and use one session, then destroy
> it, then start a whole new session on the client?

Yes, but remember that the data es stored on the server side, not the client 
side.

> I'm just starting to hate the looks of all these encoded urls being thrown
> around as i'm developing the site.  It is getting more and more complex,
> and some of the stuff i'm passing in the urls is ugly, and some of it is
> not good to be showing.

Try hidding variables in inputs (if you use forms) or store the values in a 
session.

Saludos... :-)

-- 
System Administration: It's a dirty job, 
but someone told I had to do it.
-
Martín Marqués  email:  [EMAIL PROTECTED]
Santa Fe - Argentinahttp://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-

-- 
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 problems

2001-02-21 Thread Martin A. Marques

Mensaje citado por: Jack Davis <[EMAIL PROTECTED]>:

> We have designed a web based email program that we have
> recently found a problem with...If you open up two email
> accounts in two different browser windows, the first window
> opened takes on the session that the second window is in.
> It appears that you can open up as many sessions as you
> like, but all open windows take on the session properties
> of the most recently opened session...This happens in Windows 
> and Linux with either IE or Netscape...Has anyone else
> had this problem and if so how can I work around it...

That is because you're usuing cookies, and the cookie is part of the bowsers
information. Opening another netscape session isn't really a new netscape, but a
new browser using the same session. And, by default, the cookie will die when
the browser is close.

Saludos... :-)



System Administration: It's a dirty job,
but someone told I had to do it.
-
Martín Marqués  email:  [EMAIL PROTECTED]
Santa Fe - Argentinahttp://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-

-- 
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 problems

2001-02-22 Thread php3

Addressed to: Jack Davis <[EMAIL PROTECTED]>
  [EMAIL PROTECTED]

** Reply to note from Jack Davis <[EMAIL PROTECTED]> Wed, 21 Feb 2001 14:58:13 
-0600
>
> We have designed a web based email program that we have
> recently found a problem with...If you open up two email
> accounts in two different browser windows, the first window
> opened takes on the session that the second window is in.
> It appears that you can open up as many sessions as you
> like, but all open windows take on the session properties
> of the most recently opened session...This happens in Windows
> and Linux with either IE or Netscape...Has anyone else
> had this problem and if so how can I work around it...


I bet you are using cookies to keep track of them.  If so, all open
windows in a browser share the same set of cookies.  The fix is to move
the information that identifies which account they are working in to the
URL.




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com

--
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 question

2001-02-23 Thread Chris Lee

some comments on sessions

- $PHPSESSID will only be set after the first page refresh.
- SID will only be set if your not using cookies.
- sessions with not transfer across multiple domain names.
- sessions without cookies will not transfer accross full urls.



use this code and

- sessions will transfer across full urls when using $SID
- sessions will transer across multiple domain names on the same server
using $SID
- both $PHPSESSID and $SID are set allways set.

remember that header redirects *require* full urls so you will have to use
$SID.

header("Location: http://$SERVER_NAME/index.php?$SID");


--

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]



""Jon Rosenberg"" <[EMAIL PROTECTED]> wrote in message
001301c09dc9$fc471c80$[EMAIL PROTECTED]">news:001301c09dc9$fc471c80$[EMAIL PROTECTED]...
> I have a form that submits to abc.php which then calls db.php and db.php
> then redirects to a new URL.  I have session_start(); on all these files
and
> I'm registering the variables I need.  It seems that the session dies or
> gets lost on it's way through all the included files.  I then tried to
pass
> the SID in the URL that the db.php file creates, but the SID is empty once
> it gets here...though, there is a SID befoer then.  Can sessions not be
used
> with multple include files?  What could I be doing wrong?  This is my
first
> forray into sessions...be gentle!
>
> thanks!
>
> Some code below, it's prettry straight forward.  I still have cookies
> enabled, as well.  Do I need to disable cookies for the SID in URL method
to
> work?
>
> index.php where they log in from
>  session_start();  //first line of file
> ?>
> 
> 
> Username  
> Password   />
>    
>
> code from main.php
>  session_register();
> require ("db.php");
> if $form_action == "lrlogin"
> {
> get_user($username,$password);
> }
> ?>
>
> code from db.php
>  session_start();
> SQL to select user info from db
> $access = $row[access_level]; //etc getting vars from db
> session_register("username");
> session_register("password");
> session_register("access");
> session_register("active");
> header("Location:http://www.blah.com/index2.php?=".SID);
> exit;
> ?>
>
> index2.php code
>  session_start();
>
> print "Welcome $username";
> ?>
>
> it only prints Welcome ...no username :(
>
>
> --
> 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]




Re: [PHP] session question

2001-02-23 Thread Richard Lynch

> index.php where they log in from
>  session_start();  file://first line of file

Okay.

> ?>
> 
> 
> Username  

 ?  You been typing too much XML?... :-)

Shouldn't hurt.

> Password   />
>    
>
> code from main.php
>  session_register();

Register what?  You're supposed to register a variable name...

> require ("db.php");
> if $form_action == "lrlogin"
> {
> get_user($username,$password);
> }
> ?>
>
> code from db.php
>  session_start();

Doing this after you registered a variable is bogus -- The
session_register() automatically calls this if you haven't yet.

> SQL to select user info from db
> $access = $row[access_level]; file://etc getting vars from db
> session_register("username");
> session_register("password");
> session_register("access");
> session_register("active");
> header("Location:http://www.blah.com/index2.php?=".SID);

Doing session_start() (and, by extension, session_register()) in the same
file as a header("Location:") won't work on some browsers.  You'll either
get the cookie but no redirection or vice versa, depending on which browser
you are using.

And there should be a space after 'Location:'
And you probably need SID= for the SID to get passed on.
header("Location: http://www.blah.com/index2.php?SID=".SID);

> exit;
> ?>
>
> index2.php code
>  session_start();
>
> print "Welcome $username";
> ?>
>
> it only prints Welcome ...no username :(

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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 problem

2001-02-27 Thread Chris Lee

cookies disabled and using --trans-sid ? the only way PHPSESSID can be set
is if PHPSESSID is set in the url (get) or in a form (post) if neither is
set then your hooped. a new session will be created each time.

same page  ";
?>

load this page without cookies and it will allways display 1 untill you
start clicking on the link. this is because PHPSESSID is now set.

in a long way Im trying to say that what your experisnceing is normal

--

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]


""kaab kaoutar"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi!
>
> I have a page in wich i register and fill the value of some session
> varibles:
> session_start();
> session_register("vehiculesess");
> session_register("hotelsess");
> session_register("riadsess");
> session_register("transfertsess");
> session_register("excursionsess");
> include "sessions.inc";
>
> bit when i go to other pages and come back to it , it creates a new
session
> ?! however i want to fill more that variables !
>
> NB: i also discovered that when i reload that page it creates another
> session however when i add and click on a submit button with action =echo
> PHP_Self it works, i mean it no more creates another session
> any idea ?
>
> Thanks
>
>
> _
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
> --
> 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]




Re: [PHP] session continue

2001-03-06 Thread Matthieu Le Corre

Le Mercredi  7 Mars 2001 22:12, vous avez écrit :
> I forgot to mention that I am using php3.

Hum my response was for PHP4 
for PHP3 I don't kown ...
maybe the same 




> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set for
> yourself"

-- 
__

Matthieu LE CORRE
   SERVICE INFORMATIQUE
 Ecole Polytechnique de l'Université de Nantes 
(EPUN)
Site de la Chantrerie
 Rue Christian Pauc
BP 50609
   44306 Nantes Cedex 3
02 40 68 32 23
__

-- 
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 problem?

2001-01-20 Thread Richard Lynch

> function add_toCart($id,$array) {
> session_register("OBJECT");
> $c = new Configurator;
> $c->readConfig($id);
> $OBJECT = serialize($c);
> header("Location: Cart.php");
> echo "Redirecting..."
> }
>
> Unfortunately, the session file (in /tmp) is always empty after this
> function executes.  I'm using PHP 4.0.4 with --enable-trans-sid.

I don't think you can do a Location and a Cookie in the same page, and the
Sessions are done with Cookies, so...

Don't do that.

Sorry.

By Day:|By Night:
Don't miss the Zend Web Store's|   There's not enough room here...
Grand Opening on January 23, 2001! |   Start here:
http://www.zend.com|   http://l-i-e.com/artists.htm



-- 
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 problems

2001-01-23 Thread Johannes Janson

you have to set the 'session.save_path' in your php.ini.
be careful with the slashes you use. as you can see from
the error msg by default it's '/' but windows uses '\'.

good luck
Johannes


"Jimmy Bäckström" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
001201c08564$f7398660$554d59d5@broder">news:001201c08564$f7398660$554d59d5@broder...
Yo!
I'm playing a little bit with sessions for the moment and I get a really
scary errormessage:

Warning: open(/tmp\sess_1b7577b36d874741ed1e74b4bead0dfd, O_RDWR) failed: m
(2) in h:\program\apache\htdocs/boa/sessionTest.php on line 5

Warning: open(/tmp\sess_1b7577b36d874741ed1e74b4bead0dfd, O_RDWR) failed: m
(2) in Unknown on line 0

Warning: Failed to write session data (files). Please verify that the
current setting of session.save_path is correct (/tmp) in Unknown on line 0

I understand that there is a folder missing somewhere (tmp) and I tried to
create one in the apache directory, but it still does not work. I'm using
Win2k proffesional with an apache webserver and I don't have a clue what
changes I should do to php.ini.
Please help!
/Broder B




-- 
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 problems

2001-01-23 Thread Jimmy Bäckström

Yeah I used a path name with '\' instead of '/' but it still does not work. Help!

"Johannes Janson" <[EMAIL PROTECTED]> wrote in message 
94kpfm$4cc$[EMAIL PROTECTED]">news:94kpfm$4cc$[EMAIL PROTECTED]...
> you have to set the 'session.save_path' in your php.ini.
> be careful with the slashes you use. as you can see from
> the error msg by default it's '/' but windows uses '\'.
> 
> good luck
> Johannes
> 
> 
> "Jimmy Bäckström" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> 001201c08564$f7398660$554d59d5@broder">news:001201c08564$f7398660$554d59d5@broder...
> Yo!
> I'm playing a little bit with sessions for the moment and I get a really
> scary errormessage:
> 
> Warning: open(/tmp\sess_1b7577b36d874741ed1e74b4bead0dfd, O_RDWR) failed: m
> (2) in h:\program\apache\htdocs/boa/sessionTest.php on line 5
> 
> Warning: open(/tmp\sess_1b7577b36d874741ed1e74b4bead0dfd, O_RDWR) failed: m
> (2) in Unknown on line 0
> 
> Warning: Failed to write session data (files). Please verify that the
> current setting of session.save_path is correct (/tmp) in Unknown on line 0
> 
> I understand that there is a folder missing somewhere (tmp) and I tried to
> create one in the apache directory, but it still does not work. I'm using
> Win2k proffesional with an apache webserver and I don't have a clue what
> changes I should do to php.ini.
> Please help!
> /Broder B
> 
> 
> 
> 
> -- 
> 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 problems

2001-01-24 Thread Johannes Janson

I don't know if it'll help but here my bit of the php.ini:
session.save_handler  = files   ; handler used to store/retrieve data
session.save_path = C:\Programme\Apache
Group\Apache\cgi-bin\php4\sessiondata; argument passed to
save_handler
; in the case of files, this is the
; path where data files are stored
session.use_cookies   = 1   ; whether to use cookies
session.name  = PHPSESSID
; name of the session
; is used as cookie name
session.auto_start= 0   ; initialize session on request startup
session.cookie_lifetime   = 0   ; lifetime in seconds of cookie
; or if 0, until browser is restarted

try this test-script:
Counter initialized, please reload this page to see it
increment";
} else {
echo "Waking up session $PHPSESSID";
$SESSION["count"]++;
}
echo "The counter is now $SESSION[count] ";
?>

johannes

"Jimmy Bäckström" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
007801c0859d$8ef1e0f0$554d59d5@broder">news:007801c0859d$8ef1e0f0$554d59d5@broder...
Yeah I used a path name with '\' instead of '/' but it still does not work.
Help!

"Johannes Janson" <[EMAIL PROTECTED]> wrote in message
94kpfm$4cc$[EMAIL PROTECTED]">news:94kpfm$4cc$[EMAIL PROTECTED]...
> you have to set the 'session.save_path' in your php.ini.
> be careful with the slashes you use. as you can see from
> the error msg by default it's '/' but windows uses '\'.
>
> good luck
> Johannes
>
>
> "Jimmy Bäckström" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> 001201c08564$f7398660$554d59d5@broder">news:001201c08564$f7398660$554d59d5@broder...
> Yo!
> I'm playing a little bit with sessions for the moment and I get a really
> scary errormessage:
>
> Warning: open(/tmp\sess_1b7577b36d874741ed1e74b4bead0dfd, O_RDWR) failed:
m
> (2) in h:\program\apache\htdocs/boa/sessionTest.php on line 5
>
> Warning: open(/tmp\sess_1b7577b36d874741ed1e74b4bead0dfd, O_RDWR) failed:
m
> (2) in Unknown on line 0
>
> Warning: Failed to write session data (files). Please verify that the
> current setting of session.save_path is correct (/tmp) in Unknown on line
0
>
> I understand that there is a folder missing somewhere (tmp) and I tried to
> create one in the apache directory, but it still does not work. I'm using
> Win2k proffesional with an apache webserver and I don't have a clue what
> changes I should do to php.ini.
> Please help!
> /Broder B
>
>
>
>
> --
> 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]




Re: [PHP] session question

2001-01-30 Thread Mark Green

How about this:

 session_start();
 session_register($funky_session_var);
 $funky_session_var ++;
 print $funky_session_var;


Cheers,

^^@rk

Peter Van Dijck wrote:
> 
> Hi,
> help: shouldn't this increase the number every time you reload the page?
> 
> session_start();
> $funky_session_var ++;
> session_register($funky_session_var);
> print $funky_session_var;
> 
> Peter
> 
> --
> 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]




Re: [PHP] session question

2001-01-30 Thread Teodor Cimpoesu

Hi Mark!
On Wed, 31 Jan 2001, Mark Green wrote:

> How about this:
> 
>  session_start();
>  session_register($funky_session_var);
>  $funky_session_var ++;
>  print $funky_session_var;

the order doesn't matter (as it did in PHPLib sessions).
If it doesn't work I guess it's because you have register_globals off.

-- teodor

-- 
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-variables

2001-02-05 Thread Hardy Merrill

Look at
   http://www.php.net/manual/en/html/ref.session.html

HTH.

-- 
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com

spider [[EMAIL PROTECTED]] wrote:
> Is it ok to mail questions to this list? If so;
> 
> Is there something similar like the "session variables" of ASP in PHP,
> or do one have
> to use (client-side) cookies instead?
> 
> /thanks/me
> 
> 
> -- 
> 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]




Re: [PHP] session end

2001-03-10 Thread Yasuo Ohgaki
Assuming you are talking about PHP4 session.
Garbage collection is done by the module.

Read
http://www.php.net/manual/en/ref.session.php

Regards,

--
Yasuo Ohgaki
""deco"" <[EMAIL PROTECTED]> wrote in message
98dtge$2ad$[EMAIL PROTECTED]">news:98dtge$2ad$[EMAIL PROTECTED]...
>
>   is there some kind of function or event launched when a session times
> out??
>
>   something like session_on_end() ??
>
>   i'm using a flag on a database to tell if a user is visiting the page and
> i would like to make him offline when his session expires...
>
>
>
> --
> 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]


Re: [PHP] Session problem

2001-03-13 Thread Jack Dempsey

you're using php for windows, right? well, you try to open /tmp which is
a *nix standard directory...i think you can fix that in your php.ini

jack

Brandon Orther wrote:
> 
> Hello,
> 
> Does anyone know how to fix this error?
> 
> Warning: open(/tmp\sess_4fb4c5778fe97ab351baca1d8db90abf, O_RDWR) failed: m
> (2) in c:/htdocs/br/br.php on line 2
> 
> Thank you,
> 
> 
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.com
> 
> 
> --
> 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]




Re: [PHP] Session problem

2001-03-14 Thread Pavel Kalian

set the session.save_path to a directory that exists on your system (for
example: session.save_path = c:\temp)

Pavel


- Original Message -
From: "Brandon Orther" <[EMAIL PROTECTED]>
To: "PHP User Group" <[EMAIL PROTECTED]>
Sent: Tuesday, March 13, 2001 10:56 PM
Subject: [PHP] Session problem


> Hello,
>
> Does anyone know how to fix this error?
>
> Warning: open(/tmp\sess_4fb4c5778fe97ab351baca1d8db90abf, O_RDWR) failed:
m
> (2) in c:/htdocs/br/br.php on line 2
>
> Thank you,
>
> 
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.com
> 
>
>
> --
> 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]




Re: [PHP] session destroy???

2001-03-21 Thread Yasuo Ohgaki

Use session_unset()
http://www.php.net/manual/en/function.session-unset.php


Regards,
--
Yasuo Ohgaki


""Miguel Loureiro"" <[EMAIL PROTECTED]> wrote in message
015d01c0b237$61e86720$[EMAIL PROTECTED]">news:015d01c0b237$61e86720$[EMAIL PROTECTED]...
Hello all,
when using sessions, if use command session_destroy shouldn't all variables
related with used session destroyed???
It seams that is a crazy question, but, after make a logout(session_destroy()),
I use the browser buttons to go back to inicial page and forward  until logout
page, it continues appers sessions data, it's bad because someone can enter in
my browser after me and make fully things in my page
How can I solve this problem? I already try  to use OnLoad and UnOnload events
in Javascript
T.Y all
Best Regards
Miguel Loureiro < [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]




RE: [PHP] Session Confusion

2001-03-23 Thread Jack Dempsey

If that's a copy of your code, you might want to check the if($SET=1)
line...that will always return true, because you're setting a variable, not
checking for equality...should be if($SET==1) instead

jack

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 23, 2001 10:47 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Session Confusion


Ok these sessions have got me all confused, I need to have two seperate
sessions one for when a user signs up, to stop them using there back button
and inadvertantly signing up twice. And then one when they login. Both of
them work great as standalone but if say I went and log into my account and
then decide I need another, the sign up page blocks me because I already
have
a session running. Here is some code will probably help me explain my
system.

if(!$PHPSESSID)
{
$SET=1;
}elseif($PHPSESSID=1)
{
echo"You are already Registered, please click here
 to login.";
die;
}
if($SET=1)
{
session_start();
session_register("SET");
}

This checks to see if there is a session running, if there is it blocks them
and sends them to the log in page, if there isn`t the rest of my script sets
up the account and then forwards them to the log in screen, so if for any
reason they decide to use there back button they can`t create two accounts
by
accident.

Then when they log in I start a session as follows:

session_start();
session_register("UserName","Password");
header ("Location: Http://www.tothemembersarea.com/");


So if I go to my system log in and then try to setup a new account it blocks
me, any idea how I can distinguish between the two??

TIA
Ade

--
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]




Re: [PHP] Session Confusion

2001-03-23 Thread KPortsmout


If that's a copy of your code, you might want to check the if($SET=1)
line...that will always return true, because you're setting a variable, not
checking for equality...should be if($SET==1) instead

jack

Ooops ok put that bit right, I should really know better :-) but it still 
doesn`t solve the overal problem LoL

Thanks for pointing it out though

Ade

-- 
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 Confusion

2001-03-23 Thread hi

Hi,

All the session functions check to see if you have a session running first
before starting a session, to prevent you from starting two sessions by
accident.  If for some reason you want to start another session, you can do
that by supplying your own session id to the function session_start() to
start another session.

However, you do not need to do that for your purposes.  You can start the
only  session you need when they submit their form info, and to keep them
from signing up twice, before you record the data use an if statement to
check if there is a session(if ($PHPSESSID)).  If there is already a
session, do not record the data, and display a message: "You have already
signed up, proceed to login." and redirect them to the login page.



-- 
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 Confusion

2001-03-23 Thread hi

Hi,

Just to explain a point on my previous post:

If at the top of your page that processes the registration info, you
include:

session_start();
session_register("is_registered");
is_registered="yes";

and then use this test:

if($PHPSESSID)
{
warning, redirect to login
}
else
{
record info, redirect to login
}

Will the condition in the if statement be true?  It seems like it should
because you started the session.  But a session id is a cookie, and a cookie
is not available on the page it is set.  So, the first time this script is
encountered, e.g. when they register for the first time, even though you
started the session, the if statement condition will be false, indicating
the first time someone is registering.  Subsequently, if someone uses the
back button and then clicks submit to get to this page again, then the
cookie will be set, and the if statement will return true, causing the other
branch of the if statement to execute.



-- 
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]




  1   2   3   4   >