Sessions, multiple PHP files, die() and authentication flags -


i have login built thusly:

there admin.php script checks if $_session["auth_flag"] defined "true" (string") if not, admin.php include()'s login.php

login.php generic login page module, sends xhttp request input do_login.php

if credentials correct do_login.php sets $_session["auth_flag"] true , die("0");

after login.php checks return of do_login.php if "0" location.reload() via javascript reloading page (admin.php)

however after - $_session["auth_flag"] not set.

does die() unset changes made $_session during same script?

will post relevant snippets of code on request since there no errors in error.log besides

[sun feb 07 20:45:28.957347 2016] [:error] [pid 1593] [client 89.201.9.253:18390] php notice:  session had been started - ignoring session_start() in /mnt/disk/html/dev/prefs.php on line 3 [sun feb 07 20:45:28.957766 2016] [:error] [pid 1593] [client 89.201.9.253:18390] php notice:  session had been started - ignoring session_start() in /mnt/disk/html/dev/login.php on line 3 


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -