diff options
author | nikrou <nikrou@piwigo.org> | 2006-04-17 15:13:32 +0000 |
---|---|---|
committer | nikrou <nikrou@piwigo.org> | 2006-04-17 15:13:32 +0000 |
commit | efc05de9d4cb131a910e80633965a515d506ef0f (patch) | |
tree | 3beee56653ff1aeee80b0efba9c607170cd833bd /include/functions_session.inc.php | |
parent | 790bf47d59d5d1bf29635e4bd93365c2b7a0fb6b (diff) |
bug 308: improve correction
svn merge -r1190:1191 from branch1_6 into trunk
git-svn-id: http://piwigo.org/svn/trunk@1192 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_session.inc.php')
-rw-r--r-- | include/functions_session.inc.php | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/include/functions_session.inc.php b/include/functions_session.inc.php index 96508a923..5769a6c10 100644 --- a/include/functions_session.inc.php +++ b/include/functions_session.inc.php @@ -165,26 +165,16 @@ UPDATE '.SESSIONS_TABLE.' WHERE id = \''.$session_id.'\' ;'; pwg_query($query); - if ( mysql_affected_rows()==0 ) - { // 2 possible cases: - //- the user has just login so we need to insert - //- the user went through 2 pages very fast (in the same second), so - // data and expiration are the same as before - $query = ' -SELECT id FROM '.SESSIONS_TABLE.' - WHERE id = \''.$session_id.'\' -;'; - $id = array_from_query( $query, array('id') ); - if ( empty($id) ) - { - $query = ' + if ( mysql_affected_rows()>0 ) + { + return true; + } + $query = ' INSERT INTO '.SESSIONS_TABLE.' (id,data,expiration) VALUES(\''.$session_id.'\',\''.$data.'\',now()) ;'; - pwg_query($query); - } - } + pwg_query($query); return true; } |