Hello i saw some similar topics but answers doesnt satisfy me.
Im using sessions for logging into simple admin panel and im starting it with code:
ini_set("session.gc_maxlifetime","3600");
ini_set('session.gc_probability', 0);
session_start();
if(isset($_SESSION["logged"]) && $_SESSION["logged"] == True)
...else show login form
Session worked on my VPS server, but then i moved site to my friends virtual host and session started “party”. Sometimes it stays for some minutes and sometimes it dies after page refresh showing me login form.
Site is not in root directory it lies in subdirectory “/blog” just near wordpress files(friend wanted blog inside blog)
Current session setup shown by phpinfo is:
session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_httponly Off Off
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 4 4
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /tmp /tmp
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid 0 0
Im not sitting in PHP normally, some say that i should change session directory, but i dont know how directories structure looks like in virtual hosting. But strange fact is that it currently works good on my Chrome/Win7 but totally dont work on Mac Safari. So i doubt that changing dir solve problem.
Also i have warning:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent
Can it cause this problem?