aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-04-14 22:14:53 +0000
committerrvelices <rv-github@modusoptimus.com>2006-04-14 22:14:53 +0000
commit5971c5c995849798fe3d1e75da5daab31349e945 (patch)
tree56808da8b81f47f92d1998962e696b816901d6a7 /include
parentafa5ab27a5e81ba32e797d7025fbb25a862bcfbe (diff)
fix: sessions
css 3px image border goes from both clear and dark to image.css git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1175 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/functions_session.inc.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/functions_session.inc.php b/include/functions_session.inc.php
index 482c76376..96508a923 100644
--- a/include/functions_session.inc.php
+++ b/include/functions_session.inc.php
@@ -166,13 +166,24 @@ UPDATE '.SESSIONS_TABLE.'
;';
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 = '
INSERT INTO '.SESSIONS_TABLE.'
(id,data,expiration)
VALUES(\''.$session_id.'\',\''.$data.'\',now())
;';
- pwg_query($query);
+ pwg_query($query);
+ }
}
return true;
}