Re: [PHP] help please - strange session behaviour on IIS with php4.1.2

2002-04-02 Thread Stephen Phillips

Hi,
It sounds like you are experiencing a similar problem to one I had.  It seems 
there are some problems with setting cookies when using IIS, and as I understand it 
one of the ways that sessions work is by storing the data in a cookie on the clients 
machine.  On the page at www.php.net it suggests appending the session id to the url, 
go here to look at that http://www.php.net/manual/en/ref.session.php,

An example of this would be;

?php
if (!session_is_registered('count')) {
session_register('count');
$count = 1;
}
else {
$count++;
}
?

Hello visitor, you have seen this page ?php echo $count; ? times.p;

?php
# the ?php echo SID? (?=SID? can be used if short tag is enabled) 
# is necessary to preserve the session id
# in the case that the user has disabled cookies
?

To continue, A HREF=nextpage.php??php echo SID?click here/A

on the notes at the bottom someone said this, sounds like a similar problem,

[EMAIL PROTECTED]
01-Apr-2002 04:30 
 
Using PHP 4.1.2 on IIS 5.0, Win2k, haven't migrated app yet to Linux
(later!)
Managed to eventually get the sessions to work as follows.
In the php.ini, session.auto_start = 1 
Then without a session_start(); 
$xvar = something ;
Use
session_register(xvar);
then u CAN retrieve from a later page using the new way:
$var = $_SESSION[xvar] ;
also without session_start();
even doing a var_dump($_SESSION); seems to work at least some of the time!

The odd thing is that storing vars using the new way:
$_SESSION[xvar] = something;
will save only for the CURRENT page, this gets lost when moving on to the
next page!
best regards
Mike 

Hope this helps with your problem,

Steve.

- Original Message - 
From: Wolfram Kriesing [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 02, 2002 10:44 AM
Subject: [PHP] help please - strange session behaviour on IIS with php4.1.2


 i've written a simple script, which tests the session behaviour on the IIS,
 since it didnt seem to work
 the following script should increase the session-var $testVar and display it
 but it always stays at the same value
 can someone explain that? is that a bug?
 
 also if i would increase $_SESSION['testVar'] it doesnt work.
 
 i have been looking at the server and the session-file is also updated, but
 not with the new values, only the timestamp is updated, it seems
 
 session_start();
 // make the session variable globally available
 // we have register_globals = Off
 $testVar = $_SESSION['testVar'];
 
 // init testVar to 1 or increase it
 if( !isset($testVar) )
 {
 print 'set testVar to 1br';
 $testVar = 1;
 }
 else
 {
 print 'increasebr';
 $testVar++;
 }
 
 // i can put session_register before
 // or after the 'if' it always happens the same
 session_register('testVar');
 
 print $testVar;
 
 
 the environment:
 - IIS-Server5.0, WIN2k
 - PHP4.1.2
 - session.auto_start = 0
 - register_globals = Off
 
 i am using the recommended-php.ini, that's why register_globals is off
 
 thanks for help
 --
 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] help please - strange session behaviour on IIS with php4.1.2

2002-04-02 Thread Wolfram Kriesing

On Tuesday 02 April 2002 15:34, Stephen Phillips wrote:
 Hi,
 It sounds like you are experiencing a similar problem to one I had.  It
 seems there are some problems with setting cookies when using IIS, and as I
 understand it one of the ways that sessions work is by storing the data in
 a cookie on the clients machine.  On the page at www.php.net it suggests
 appending the session id to the url, go here to look at that
 http://www.php.net/manual/en/ref.session.php,

i can definitely say, that the session-ID is always appended on the links etc.
session.use_trans_sid is on, so all links etc. are extended by the SID 
automatically, so it should not be the problem with the cookies :-(

any other suggestions?

-- 
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] help please - strange session behaviour on IIS with php4.1.2

2002-04-02 Thread Hiroshi Ayukawa

I have the same problem, while I'm using Apache for web server / Win2k.
It seems that it depends on register_globals=On or Off.
When the register_globals=On, it works well.
But when the register_globals=Off I've got the same situation; session 
doesn't work.

I guess this is a bug of PHP4.1.2/Win, isn't it?,

Regards,
Hiroshi Ayukawa
http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top

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




Re: Re: [PHP] help please - strange session behaviour on IIS with

2002-04-02 Thread Adam Voigt

I run this setup on Win2k Advanced Server
talking to a Microsoft SQL 2000 Server, with sessions of both
cookie type and URL-SessionID server side based, with absolutely
no problems.

Adam Voigt
[EMAIL PROTECTED]

On Wed, 03 Apr 2002 04:37:07 +0900, Hiroshi Ayukawa [EMAIL PROTECTED] wrote:
 I have the same problem, while I'm using Apache for web server / Win2k.
 It seems that it depends on register_globals=On or Off.
 When the register_globals=On, it works well.
 But when the register_globals=Off I've got the same situation; session
 doesn't work.
 
 I guess this is a bug of PHP4.1.2/Win, isn't it?,
 
 Regards,
 Hiroshi Ayukawa
 http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top
 
 --
 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