Re: [PHP] Overriding session length in existing session?

2011-03-08 Thread Marc Guay
Hi Scott, I'm glad you resolved your problem. I'm curious about your method though, as it seems to be an entirely different approach to my own. How do you refer to your session data throughout the rest of the site? Do you always reference the $_COOKIE variables or do you utilise $_SESSION's at

Re: [PHP] Overriding session length in existing session?

2011-03-08 Thread Scott Baker
On 03/08/2011 09:46 AM, Marc Guay wrote: Hi Scott, I'm glad you resolved your problem. I'm curious about your method though, as it seems to be an entirely different approach to my own. How do you refer to your session data throughout the rest of the site? Do you always reference the

Re: [PHP] Overriding session length in existing session?

2011-03-07 Thread Scott Baker
On 03/04/2011 11:48 AM, Marc Guay wrote: I think that my suggestion is still a valid solution, someone correct me if I'm wrong. Let's say your code went like this: session_start(); I did a ton of digging and came up with session_regenerate_id() In my header.php I start the session as

Re: [PHP] Overriding session length in existing session?

2011-03-07 Thread Scott Baker
On 03/04/2011 11:48 AM, Marc Guay wrote: I think that my suggestion is still a valid solution, someone correct me if I'm wrong. Let's say your code went like this: session_start(); I did a ton of digging and came up with session_regenerate_id() In my header.php I start the session as

Re: [PHP] Overriding session length in existing session?

2011-03-05 Thread tedd
At 5:00 PM -0800 3/3/11, Scott Baker wrote: On 03/03/2011 04:31 PM, tedd wrote: Simple answer -- put session_start() at the start of your code -- first line. Of index.php or header.php? You lost me. -- Scott Baker - Canby Telcom Scott: The statement should be at the start of every php

Re: [PHP] Overriding session length in existing session?

2011-03-05 Thread Marc Guay
The statement should be at the start of every php file that has php code in it. Hi Tedd, Normally I'd agree with this but having never used the function session_set_cookie_params() before, I looked it up, and the manual says to put it before session_start(). Set cookie parameters defined in

Re: [PHP] Overriding session length in existing session?

2011-03-05 Thread tedd
At 1:29 PM -0500 3/5/11, Marc Guay wrote: The statement should be at the start of every php file that has php code in it. Hi Tedd, Normally I'd agree with this but having never used the function session_set_cookie_params() before, I looked it up, and the manual says to put it before

Re: [PHP] Overriding session length in existing session?

2011-03-04 Thread Marc Guay
This is called globally in *all* my scripts. In another script I'd really like to set the session to expire after the browser closes if a uses clicks public terminal or something. Howdy. Don't sessions expire when the browser closes as a rule? Do you mean the session cookie? Why not store

Re: [PHP] Overriding session length in existing session?

2011-03-04 Thread Marc Guay
I think that my suggestion is still a valid solution, someone correct me if I'm wrong. Let's say your code went like this: session_start(); // Check to see if the session variable has already been set, if not if (!isset($_SESSION['var'])){ // Check to see if it's been stored in a

[PHP] Overriding session length in existing session?

2011-03-03 Thread Scott Baker
I have a global header.php file that sets up a bunch of stuff: DB, global variables, and does session_start(). My header.php looks like this: #header.php $cookie_life = (86400 * 7); // Cookies last for seven days session_set_cookie_params($cookie_life,/,.domain.com,true); session_start(); This

Re: [PHP] Overriding session length in existing session?

2011-03-03 Thread tedd
At 2:58 PM -0800 3/3/11, Scott Baker wrote: I have a global header.php file that sets up a bunch of stuff: DB, global variables, and does session_start(). My header.php looks like this: #header.php $cookie_life = (86400 * 7); // Cookies last for seven days

Re: [PHP] Overriding session length in existing session?

2011-03-03 Thread Scott Baker
On 03/03/2011 04:31 PM, tedd wrote: At 2:58 PM -0800 3/3/11, Scott Baker wrote: I have a global header.php file that sets up a bunch of stuff: DB, global variables, and does session_start(). My header.php looks like this: #header.php $cookie_life = (86400 * 7); // Cookies last for seven