php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26785 session_set_save_handler -- gc() arguments
Submitted: 2004-01-04 13:44 UTC Modified: 2004-01-13 05:23 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: dsimic at urc dot bl dot ac dot yu Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.4 OS: Linux
Private report: No CVE-ID: None
 [2004-01-04 13:44 UTC] dsimic at urc dot bl dot ac dot yu
Description:
------------
While implementing my own user--level database--based 
session handling class, found a *weird* thing: As stated in 
oficial PHP documentation on this page, rough--shaped 
garbage collecting function looks like:

function gc ($maxlifetime) {
  return true;
}

But I found that this function should have *NO* arguments! 
While having one argument, error message was like this:

Warning: Missing argument 1 for _sessiongc() in 
<mySessionMgmtClass.class.php> on line <lineNo>

I removed any arguments for this PHP function, and finally 
ended with this rough--shaped gc function, which works:

function gc() {
  $maxlifetime = ini_get ('session.gc_maxlifetime');
  return true;
}

I even looked around in php-4.3.4/ext/session/mod_user.c but
as I'm not a PHP engine developer, coudn't find any obvious 
cause of this.



Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-06 18:19 UTC] sniper@php.net
You're doing something very wrong. The function definately REQUIRES one parameter. (works fine for me)

 [2004-01-13 03:48 UTC] dsimic at urc dot bl dot ac dot yu dot NOSPAM
I've also triple checked, and there is nothing wrong I'm
doing, as I've also tried an absolutely stripped down version
of the test; and I still get "Missing argument..." error
when I leave _sessiongc() with one argument.
 [2004-01-13 05:22 UTC] sniper@php.net
Try the latest stable CVS snapshot, this works fine with it.
(from http://snaps.php.net)

If you still claim to be able to reproduce this, provide a complete but short example script.


 [2004-01-15 16:43 UTC] dsimic at urc dot bl dot ac dot yu dot NOSPAM
I'll try that in the next seven days, and will report
the results.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Aug 15 23:01:28 2024 UTC