tags:

views:

106

answers:

2

Hi, 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!

+1  A: 

the best solution is not to touch session cookie params at all
sessions works pretty fine with default values. and with manual correction you'd make it worst.

as for your question, session_get_cookie_params works fine. it shows you current settings which don't seem to be altered in this another file.

Col. Shrapnel
+1  A: 

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.

Reuben