aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_session.inc.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-10-06 22:48:48 +0000
committerz0rglub <z0rglub@piwigo.org>2004-10-06 22:48:48 +0000
commit11699a554688e1215bae9c550a5a67c15cdb8f36 (patch)
treed1e23ac0f904d651df37ee8a349415a888f94383 /include/functions_session.inc.php
parent944fb4856ed687de9f525d3d515d6f7b2287bb69 (diff)
- checkbox for "remember me" are only shown if authorized
- simplification : each session is created with a cookie and if PhpWebGallery can't read the cookie, it uses the URI id and it will be used in the add_session_id function. - configuration parameter "auth_method" disappeared (didn't lived much...) - only one session id size possible. More comments for configuration in include/config.inc.php git-svn-id: http://piwigo.org/svn/trunk@555 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_session.inc.php')
-rw-r--r--include/functions_session.inc.php10
1 files changed, 3 insertions, 7 deletions
diff --git a/include/functions_session.inc.php b/include/functions_session.inc.php
index ce66e3a30..bb0fca11c 100644
--- a/include/functions_session.inc.php
+++ b/include/functions_session.inc.php
@@ -62,11 +62,10 @@ function generate_key($size)
* - return session identifier
*
* @param int userid
- * @param string method : cookie or URI
* @param int session_lentgh : in seconds
* @return string
*/
-function session_create($userid, $method, $session_length)
+function session_create($userid, $session_length)
{
global $conf;
@@ -74,7 +73,7 @@ function session_create($userid, $method, $session_length)
$id_found = false;
while (!$id_found)
{
- $generated_id = generate_key($conf['session_id_size_'.$method]);
+ $generated_id = generate_key($conf['session_id_size']);
$query = '
SELECT id
FROM '.SESSIONS_TABLE.'
@@ -97,10 +96,7 @@ INSERT INTO '.SESSIONS_TABLE.'
;';
mysql_query($query);
- if ($method == 'cookie')
- {
- setcookie('id', $generated_id, $session_length+time(), cookie_path());
- }
+ setcookie('id', $generated_id, $expiration, cookie_path());
return $generated_id;
}