Passing php session variables to multiple pages -
i having problems passing session variables on website. can echo session variables on advertiser/page2.php when go 3rd page sessions gone.
can please me fix issue?
login.php
session_start(); $_session['account_id']= $account_id; $_session['user_email']= $user_email;
advertiser/page2.php
session_start();
advertiser/page3.php
session_start();
here settings on phpinfo()
directive local value master value session.auto_start off off session.bug_compat_42 off off 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 5 5 session.hash_function 0 0 session.name phpsessid phpsessid session.referer_check no value no value session.save_handler files files session.save_path no value no value session.serialize_handler php php session.use_cookies on on session.use_only_cookies off off session.use_trans_sid 0 0
i have run issue several times php , frustrating,
what not set session id using session_id([new_session_id])
md5 (http://php.net/manual/en/function.md5.php) hash of string such username combined arbitrary string. username tied user data.
the session id recalculated (which might minimal performance cost) can find session when need it, since result deterministic.
i not sure if best method, around idea seems have never failed me when dealing maintaining sessions in php.
Comments
Post a Comment