Forum Moderators: coopster
On the first page I call sessin_start() - shown below- and register the variable "rights".
session_start();
session_register("rights");
...and I .....
if($user_right == "ADMIN"){ $rights ="ADMIN";}
if($user_right == "INSERT"){ $rights ="INSERT";}
if($user_right == "PICK"){ $rights ="PICK";}
print "$rights";
if(session_is_registered("rights")) print "help me";
...set the session variable according to a profile gotten from a Mysql database (INSERT-rights, ADMIN-rights, or PICK-rights).
So far everythings works and I get the message"help me" on the screen. The attribute for the varialbe "rights" is a s well stored - as seen below - in the seesion file:
data in session file:
rights¦s:6:"INSERT";
Now the problem:
As soon as I call the variable on a different php-side(file) and want to track the information according to a session I can`t read from the "rights" varialbe . Even the session_is_registered doesn`t work with the follwowing code on the other php-side.
// $user_right = "ADMIN";
if(session_is_registered("rights")) print "help me again";
if($rights == "ADMIN"){ $user_right = "ADMIN";}
if($rights == "INSERT"){ $user_right = "INSERT";}
if($rights == "PICK"){ $user_right = "PICK";}
print "$user_right";
Here my php.ini settings:
[Session]
session.save_handler = files
session.save_path = C:/temp
session.use_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_maxlifetime = 1440
session.referer_check =
session.entropy_length = 0
session.entropy_file =
aspects.
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 1
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
...thanks for help
Welcome [webmasterworld.com] to Webmaster World! ;)
...it works..:-)
.thanks for your quick and fantastic help...