im looking into sessions a bit more and would like some input.
on a simple login form once the form is submited i have the following
.
..
...
session_name('TOKEN');
session_set_cookie_params( time() + 600, './', 'example.co.uk', false, false);
session_start();
$_SESSION['TOKEN'] = TOKEN;
...
..
.
and then when a request to the server is made I have this.
.
..
...
session_name('TOKEN');
$session_data = session_get_cookie_params();
print_r($session_data);
...
..
.
which returns Array ( [lifetime] => 0 [path] => / [domain] => [secure] => [httponly] => )
as you can see something is not working or I am missing something or im going a little potty!
anyway, If anyone has any input on where im going wrong i would love to here it!
You may have figured it out already, but session_set_cookie_params() needs to be called before session_start() for every single page request. So sayth the manual entry for the function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With