Forum Moderators: coopster

Message Too Old, No Replies

Sessions

         

georgiek50

12:11 am on Feb 22, 2004 (gmt 0)

10+ Year Member



I am new to PHP but learning quick. I am at the point now where I have made some forms and am using session tracking in case there have been some errors (eg. incomplete fields) with an error message and a BACK button to retain the info that has been entered.

If I am correct, session_destroy(); will get rid of the session data, and I use this when the form has been submitted successfully. The question is, if the user decides that he/she doesn't want to go back and do it until they get it right (and hence call session_destroy();) what happens to those variables. Do they get erased by default and you need to write functions to actually save them to a file or database or is it the other way around where I need to modify my code to delete them?

jatar_k

5:25 pm on Feb 22, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



ultimately the session will die and it will be cleaned up.

from PHP Session handling functions [ca3.php.net]

There is a setting in php.ini for
session.gc_maxlifetime

session.gc_maxlifetime specifies the number of seconds after which data will be seen as 'garbage' and cleaned up.

georgiek50

5:47 pm on Feb 22, 2004 (gmt 0)

10+ Year Member



Thanks for clarifying.