[PHP] Session trubles

2003-11-19 Thread mgraf
PHP Version: 4.2.2

Hi

I had a problem with my session name.

In the php.ini, was set the default name PHPSESSID from the default
installation. Now i have the problem, that i use the name audience for
my webapplikations with PHPope (http://www.phpope.org)

I Set the name in the script with the following code:
session_name(audience);
session_set_cookie_params(time()+999, /, $config[default][cookiedomain]);
session_cache_limiter('no_cache');
session_start();

Now i had the problem, that i lost the session after login. The server
forgave me a new session which called PHPSESSID and not audience :-(

Now i have changed the value session.name in my php.ini to audience and it
works!

What's the problem here? A bug?

I have enabled session.auto_start.

Mit freundlichen Grüssen

Markus Graf
Hauptstrasse 80
9434 Au
0041 (0)79 / 261 16 37
[EMAIL PROTECTED]

-- 
Software is like sex, it's better when it's free!

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



Re: [PHP] Session trubles

2003-11-19 Thread Marek Kilimajer
mgraf wrote:

PHP Version: 4.2.2

Hi

I had a problem with my session name.

In the php.ini, was set the default name PHPSESSID from the default
installation. Now i have the problem, that i use the name audience for
my webapplikations with PHPope (http://www.phpope.org)
I Set the name in the script with the following code:
session_name(audience);
session_set_cookie_params(time()+999, /, $config[default][cookiedomain]);
session_cache_limiter('no_cache');
session_start();
Now i had the problem, that i lost the session after login. The server
forgave me a new session which called PHPSESSID and not audience :-(
Now i have changed the value session.name in my php.ini to audience and it
works!
What's the problem here? A bug?

I have enabled session.auto_start.
This is the problem, the session is started before your script executes 
and sets the session name. Disable session.auto_start

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


Re: [PHP] Session trubles

2003-11-19 Thread mgraf
PHP Version 4.3.3

Ok i have disabled the autostart. Now is my problem, that php us the
transparent sessions, because it append it in the URL. After the login,
all  works fine, but after 5-6  clicks, i loose the session.

It send me a Cookie :
Set-Cookie: audience=a01b3fcf7cb587eee3ac61bc83edebe4; expires=Wed, 25-Dec-1901 
16:01:15 GMT; path=/; domain=www.privatmarkt.com

My mozilla is adjusted to accept all cookies.
I'm confused. What is with the time? 25-Dec-1901 16:01:15 GMT!!
I set the time in the futur with the following code:

session_set_cookie_params(time()+999, /, $config[default][cookiedomain]);


On Wed, 19 Nov 2003, Marek Kilimajer wrote:

 mgraf wrote:

  PHP Version: 4.2.2
 
  Hi
 
  I had a problem with my session name.
 
  In the php.ini, was set the default name PHPSESSID from the default
  installation. Now i have the problem, that i use the name audience for
  my webapplikations with PHPope (http://www.phpope.org)
 
  I Set the name in the script with the following code:
  session_name(audience);
  session_set_cookie_params(time()+999, /, $config[default][cookiedomain]);
  session_cache_limiter('no_cache');
  session_start();
 
  Now i had the problem, that i lost the session after login. The server
  forgave me a new session which called PHPSESSID and not audience :-(
 
  Now i have changed the value session.name in my php.ini to audience and it
  works!
 
  What's the problem here? A bug?
 
  I have enabled session.auto_start.

 This is the problem, the session is started before your script executes
 and sets the session name. Disable session.auto_start

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



Mit freundlichen Grüssen

Markus Graf
Hauptstrasse 80
9434 Au
0041 (0)79 / 261 16 37
[EMAIL PROTECTED]

-- 
Software is like sex, it's better when it's free!

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



Re: [PHP] Session trubles

2003-11-19 Thread Marek Kilimajer
mgraf wrote:

PHP Version 4.3.3

Ok i have disabled the autostart. Now is my problem, that php us the
transparent sessions, because it append it in the URL. After the login,
all  works fine, but after 5-6  clicks, i loose the session.
It send me a Cookie :
Set-Cookie: audience=a01b3fcf7cb587eee3ac61bc83edebe4; expires=Wed, 25-Dec-1901 
16:01:15 GMT; path=/; domain=www.privatmarkt.com
My mozilla is adjusted to accept all cookies.
I'm confused. What is with the time? 25-Dec-1901 16:01:15 GMT!!
I set the time in the futur with the following code:
session_set_cookie_params(time()+999, /, $config[default][cookiedomain]);
The first parameter is relative to the current time. I would recomend 
for security reasons to leave this to the default, 0 - until the browser 
is closed. Otherwise this could lead to session hijacking - when the bad 
guy uses your site and gets a cookie with long lifetime, he knows that 
the cookie with session id will be used for other users using the same 
browser.

Marek

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


Re: [PHP] Session trubles

2003-11-19 Thread mgraf

Thanks that was my problem :-)

On Wed, 19 Nov 2003, Marek Kilimajer wrote:

 The first parameter is relative to the current time. I would recomend
 for security reasons to leave this to the default, 0 - until the browser
 is closed. Otherwise this could lead to session hijacking - when the bad
 guy uses your site and gets a cookie with long lifetime, he knows that
 the cookie with session id will be used for other users using the same
 browser.

Mit freundlichen Grüssen

Markus Graf
Hauptstrasse 80
9434 Au
0041 (0)79 / 261 16 37
[EMAIL PROTECTED]

-- 
Software is like sex, it's better when it's free!

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