If I want to have the session last for a month, I set $x to whatever many seconds a month is, and if it's 0, it's until the browser closes correct?
Code: Select all
session_set_cookie_params($x)If I want to have the session automatically start if the user is still within that month. I can do the following I hope.
Code: Select all
if(session_id() != FALSE)
{
session_start(session_id());
}When someone logs out. How do I clear their session data. It seems when I try it, that it just starts again because it never really clears.
Code: Select all
session_destroy();
session_unset();
$_SESSION = array();Now the real problem I came to ask about is that on one page, $_SESSION['uid'] is the user name, but on the next page, when I don't even touch the session array, the 'uid' becomes an array and I have to call $_SESSION['uid'][0] to get it to work. What is up with this?!
-------------------
Any help, advice, useful information would be appreciated. I had it working so perfectly on my computer, but I moved servers and it all went to hell. I assume it's because I have my php.ini file set differently then their servers, so auto_start and the lifetime I had working for me on my computer.
Edit: Side note while I have your attention. For my forums...how do I keep track of how many times a page has been viewed?