PHP Session Problem
Posted: Wed Nov 17, 2004 6:28 am
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.
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
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 = 0lib/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