Page 1 of 1

PHP Session Problem

Posted: Wed Nov 17, 2004 6:28 am
by junrey
Hello to All:

I was having this problem with session in PHP. I have the following session configuration and works totally OK while I am testing my codes on my local machine.

Code: Select all

session.save_handler = files

session.save_path = c:\windows\temp

session.use_cookies = 1

; session.use_only_cookies = 1

session.name = PHPSESSID

session.auto_start = 0

session.cookie_lifetime = 0

session.cookie_path = /

session.cookie_domain =

session.serialize_handler = php

session.gc_probability = 1

session.gc_divisor     = 100

session.gc_maxlifetime = 1440

session.bug_compat_42 = 1

session.bug_compat_warn = 1

session.referer_check =

session.entropy_length = 0

session.entropy_file =

;session.entropy_length = 16

;session.entropy_file = /dev/urandom

session.cache_limiter = nocache

session.cache_expire = 180

session.use_trans_sid = 0
When somebody accesses my machine and tries to login, they are always redirected back to the login page. Here is the basic file structure of my codes.

lib/init.php = where session_start() function occurs

config.php = requires lib/init.php
If $_SESSION['username'] is not set then redirect to login.php

index.php = requires config.php

login.php
If user is authenticated then set the $_SESSION['username'] variable and redirect to index.php

I have found out that every redirection that I made uses a different session cookie. But if I access it on my local machine, it only uses a single cookie until the browser is restarted.

Any help is highly appreciated.


Junrey

PHP Session Problem

Posted: Wed Nov 17, 2004 7:29 am
by junrey
Hello:

After giving someting looking through the web and trying to find answer to the problem, I found out this interesting article from Microsoft. The problem I had only occur in IE Browser(mine is 6.0). The is a new feature??? that microsoft introduced in their MS01-MS55 patch.

http://support.microsoft.com/default.as ... -US;316112

Have a nice day!


Junrey

PHP Session Problem

Posted: Wed Nov 17, 2004 7:32 am
by junrey
I finally solved my problem. Thanks to the note by

Code: Select all

m dot kuiphuis at hccnet dot nl
http://us2.php.net/function.session-start which gives me the idea about it.