[geeklog-cvs] geeklog-1.3/system lib-sessions.php,1.16,1.17
geeklog-cvs-admin at lists.geeklog.net
geeklog-cvs-admin at lists.geeklog.net
Wed May 21 06:33:23 EDT 2003
Update of /usr/cvs/geeklog/geeklog-1.3/system
In directory internal.geeklog.net:/tmp/cvs-serv23666
Modified Files:
lib-sessions.php
Log Message:
Added debug output and cleaned up comments in SESS_setSessionCookie().
Index: lib-sessions.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/system/lib-sessions.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** lib-sessions.php 8 May 2003 17:23:10 -0000 1.16
--- lib-sessions.php 21 May 2003 10:33:20 -0000 1.17
***************
*** 245,249 ****
// Create new session
! $sql = "INSERT INTO {$_TABLES['sessions']} (sess_id, md5_sess_id, uid, start_time, remote_ip) VALUES ($sessid, '$md5_sessid', $userid, $currtime, '$remote_ip')";
$result = DB_query($sql);
if ($result) {
--- 245,253 ----
// Create new session
! if (empty ($md5_sessid)) {
! $sql = "INSERT INTO {$_TABLES['sessions']} (sess_id, uid, start_time, remote_ip) VALUES ($sessid, $userid, $currtime, '$remote_ip')";
! } else {
! $sql = "INSERT INTO {$_TABLES['sessions']} (sess_id, md5_sess_id, uid, start_time, remote_ip) VALUES ($sessid, '$md5_sessid', $userid, $currtime, '$remote_ip')";
! }
$result = DB_query($sql);
if ($result) {
***************
*** 269,284 ****
*
* @param string $sessid Session ID to save to cookie
! * @param string $cookietime Cookie timeout value
* @param string $cookiename Name of cookie to save sessiond ID to
* @param string $cookiepath Path in which cookie should be sent to server for
* @param string $cookiedomain Domain in which cookie should be sent to server for
! * @param string $cookiesecure Not sure but don't use it anyway
*
*/
function SESS_setSessionCookie($sessid, $cookietime, $cookiename, $cookiepath, $cookiedomain, $cookiesecure)
{
! // This sets a cookie that will persist until the user closes their browser window.
! // since session expiry is handled on the server-side, cookie expiry time isn't a big deal.
! setcookie($cookiename,$sessid,0,$cookiepath,$cookiedomain,$cookiesecure);
}
--- 273,298 ----
*
* @param string $sessid Session ID to save to cookie
! * @param int $cookietime Cookie timeout value (not used)
* @param string $cookiename Name of cookie to save sessiond ID to
* @param string $cookiepath Path in which cookie should be sent to server for
* @param string $cookiedomain Domain in which cookie should be sent to server for
! * @param int $cookiesecure if =1, set cookie only on https connection
*
*/
function SESS_setSessionCookie($sessid, $cookietime, $cookiename, $cookiepath, $cookiedomain, $cookiesecure)
{
! global $_SESS_VERBOSE;
!
! // This sets a cookie that will persist until the user closes their browser
! // window. since session expiry is handled on the server-side, cookie expiry
! // time isn't a big deal.
! if ($_SESS_VERBOSE) {
! COM_errorLog ("Setting session cookie: setcookie($cookiename, $sessid, 0, $cookiepath, $cookiedomain, $cookiesecure);", 1);
! }
!
! if (setcookie ($cookiename, $sessid, 0, $cookiepath, $cookiedomain,
! $cookiesecure) === false) {
! COM_errorLog ('Failed to set session cookie.', 1);
! }
}
More information about the geeklog-cvs
mailing list