X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=session.php;h=4efec20e32d649217d2933e0282c7ad4e2009886;hb=0848aa3606b38ec51701960b9cbd84bea0fbd8ce;hp=b04ed57e3edb5a41945cf7264e07f013b69fb7f1;hpb=4f94560f060a7305ea791def3950adb1bda092ec;p=wfpl.git diff --git a/session.php b/session.php index b04ed57..4efec20 100644 --- a/session.php +++ b/session.php @@ -18,7 +18,7 @@ # along with wfpl; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -# you'll need this file that calles db_connect() +# you'll need this file that calls db_connect() if(!isset($GLOBALS['wfpl_db_handle'])) { if(file_exists('db_connect.php')) { require_once('db_connect.php'); @@ -32,6 +32,9 @@ if(!isset($GLOBALS['wfpl_db_handle'])) { # and these database tables: # create table wfpl_sessions (id int unique auto_increment, session_key varchar(16), length int, expires int); # create table wfpl_session_data (id int unique auto_increment, session_id int, name varchar(100), value text); +# run this command to install/clear the tables: +# mysql DATABASE_NAME < code/wfpl/examples/session.sql +# note: you may need these parameters for mysql: -u USERNAME -p # GLOSSARY # @@ -68,6 +71,7 @@ function session_new($length = 86400) { $GLOBALS['session_key'] = $session_key; $_REQUEST['session_key'] = $session_key; #just in case someone calls session_exists() after session_new() session_touch($length); + return $GLOBALS['session_key']; } # call to renew the timeout for the session.