Skip Menu |

This queue is for tickets about the CGI-Session CPAN distribution.

Report information
The Basics
Id: 24285
Status: resolved
Priority: 0/
Queue: CGI-Session

People
Owner: MARKSTOS [...] cpan.org
Requestors: wrp [...] virginia.edu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: William Pearson <wrp [...] virginia.edu>
Subject: CGI-Session does not support {Directory=>/not_tmp}
Date: Tue, 9 Jan 2007 08:44:42 -0500
To: bug-CGI-Session [...] rt.cpan.org
From: "William R. Pearson" <wrp [...] virginia.edu>
It appears to me that CGI::Session (version 4.13) does not actually support changing the session ID directory via the {Directory=>"/ not_tmp/sessions"} third option to CGI::Session->new(). I have a program that works fine under version 3.95, but under 4.1X, if I specify the directory, either: (1) a new session is created in /tmp each time, presumably because the session file is not placed in /not_tmp/sessions/session_id the first time, but it is looked for on subsequent invocations. (2) sometimes, the same cgi session file is created both in /not_tmp/ sessions and in /tmp. In this case, the file does not keep session information from one session to the next. The problems with my program vanish if the {Directory=>"/not_tmp"} option is not used. I have observed this problem both on MacOSX and Sun Solaris. Bill Pearson wrpmpb 28% perl -V Summary of my perl5 (revision 5 version 8 subversion 6) configuration: Platform: osname=darwin, osvers=8.0, archname=darwin-thread-multi-2level uname='darwin b20.apple.com 8.0 darwin kernel version 8.3.0: mon oct 3 20:04:04 pdt 2005; root:xnu-792.6.22.obj~2release_ppc power macintosh powerpc ' config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe - Dldflags=-Dman3ext=3pm -Duseithreads -Duseshrplib' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-g -pipe -fno-common -DPERL_DARWIN -no-cpp- precomp -fno-strict-aliasing -I/usr/local/include', optimize='-Os', cppflags='-no-cpp-precomp -g -pipe -fno-common -DPERL_DARWIN -no- cpp-precomp -fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='3.3 20030304 (Apple Computer, Inc. build 1819)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='-L/usr/ local/lib' libpth=/usr/local/lib /usr/lib libs=-ldbm -ldl -lm -lc perllibs=-ldl -lm -lc libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, libperl=libperl.dylib gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-bundle -undefined dynamic_lookup -L/ usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Locally applied patches: 23953 - fix for File::Path::rmtree CAN-2004-0452 security issue 33990 - fix for setuid perl security issues SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962 Built under darwin Compiled at Oct 14 2006 00:15:28 @INC: /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread-multi-2level /Network/Library/Perl/5.8.6 /Network/Library/Perl /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.6 /Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.8.1 .
Subject: Re: [rt.cpan.org #24285] CGI-Session does not support {Directory=>/not_tmp}
Date: Tue, 09 Jan 2007 11:34:52 -0500
To: bug-CGI-Session [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
William R. Pearson via RT wrote: Show quoted text
> > It appears to me that CGI::Session (version 4.13) does not actually > support changing the session ID directory via the {Directory=>"/ > not_tmp/sessions"} third option to CGI::Session->new(). > > I have a program that works fine under version 3.95, but under 4.1X, > if I specify the directory, either: > > (1) a new session is created in /tmp each time, presumably because > the session file is not placed in /not_tmp/sessions/session_id the > first time, but it is looked for on subsequent invocations. > > (2) sometimes, the same cgi session file is created both in /not_tmp/ > sessions and in /tmp. In this case, the file does not keep session > information from one session to the next. > > The problems with my program vanish if the {Directory=>"/not_tmp"} > option is not used. > > I have observed this problem both on MacOSX and Sun Solaris.
Bill, Thanks for the report, and I'm sorry you had upgrade trouble. Would you be willing to submit a Test::More style test case to illustrate the issue? If it's confirmed as a bug, we'll add it to the test suite to prevent the issue from re-appearing. Mark
Subject: Re: [rt.cpan.org #24285] CGI-Session does not support {Directory=>/not_tmp}
Date: Tue, 9 Jan 2007 12:01:16 -0500
To: bug-CGI-Session [...] rt.cpan.org
From: "William R. Pearson" <wrp [...] virginia.edu>
Mark - I fear that I am such a Perl novice that figuring out test scripts would be quite a stretch. I will see if I can enlist the help of one of my colleagues. Until then - I believe I may have found the root of the problem. It looks to me like "{Directory => '/not_tmp'}" is set in $self-> {DRIVER_ARGS}->{}, 0 CGI::Session=HASH(0x1b45d44) '_CLAIMED_ID' => undef '_DATA' => HASH(0x1b45d8c) '_SESSION_ATIME' => 1168359603 '_SESSION_CTIME' => 1168359603 '_SESSION_ID' => 'b2fb5bc07d11f76e12a025981b560eeb' '_SESSION_REMOTE_ADDR' => '' '_DRIVER_ARGS' => HASH(0x1b37a78) 'Directory' => '/tmp/psisearch2/sessions' '_DSN' => HASH(0x197dfe0) 'driver' => 'file' 'id' => 'md5' 'serializer' => 'default' '_OBJECTS' => HASH(0x1b45d68) 'id' => 'CGI::Session::ID::md5' '_QUERY' => CGI=HASH(0x1b37afc) but, there is no reference to DRIVER_ARGS in Driver.pm or Driver/ file.pm. Instead, the reference is to self->{Directory}, which is not set properly. Bill Pearson
Ron Savage reported this is fixed in our code repo. Mark