Why my php sessions don't work properly?


I start the files with session_start () but the sessions do not load! Database works properly and I logged in, but the sessions were not been created!

1 Like

Hi @rcovery,
Your website seems to be fine. And about your php code error, please check for errors in your written code. Hope it helps!

I have similar error can you post error log

@rcovery @tekaranle

Can you please share what you are trying to do, and what part of it is not working? Also, try taking a search of the forum using the search function in the upper left. Additionally, please share any relevant code.

In localhost works.

I create sessions here:
$_SESSION["user"] = $username; $_SESSION["id"] = $ID_user;

I start sessions and I put var_dump in the index.php and login page:
if ((new User())->login($data)) { // header("location: ../index.php"); var_dump($_SESSION); }

var_dump in login page after I log in:
array(3) { [“user”]=> string(4) “test” [“id”]=> string(2) “28” [“keep_logged”]=> NULL }

var_dump when I redirect to index page after I log in:

1 Like

same error !!!

i am also facing the same problem for the newly hosted websites !!

Welcome to the form @premsai2030!
Can you please share your error message and domain?

The session issue was a server issue that has been fixed. Are you use you have the exact same problem?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.