sessionnoob. Will someone explain why the session var is assigned in reverse order, $_SESSION[‘name’] = $myVar;
and not, $myVar = $_SESSION[‘name’];
And number two, my host has magic quotes turned on, so I have a little scriptie scrubbing all my php vars (post, get, cookie, etc.). When I added the session var, for example, $_SESSION = array_map(‘trim’, $_SESSION);
to the list, PHP generated an error saying session is not an array, or some such malarky. Now that I look at it, I don’t need to do mysql-real-escape-string or strip-slashes to the session var since its not user input, but why would php say its not an array? or is this just an erroneous error report?
The session is not brought into life unless you call session_start. What that does is look for a cookie from the browser (and if not found, sends one), and loads a text file tied to the session id. TBH I forget exactly what happens as that logic is tucked away in my fw, but you can easily find out by var_dump ing $_SESSION before and after calling session_start.