$obj->{'q'} isa CGI
$obj->{'cfg'} isa Config::Simple
This is from a test script in my current project:
When run as root, it works fine, except that it puts the session file in /tmp/sessions, as my /etc/MyProject/config.ini file tells it to. However, when I run this as an unprivileged user, I get the error which follows:$obj->{'q'}->param('username','admin'); $obj->{'q'}->param('password','secret'); diag('The value starts as: ' . $obj->{'cfg'}->param("paths.sessions")) +; $obj->{'cfg'}->param("paths.sessions",'/home/hesco/sandbox/My-Project/ +t/sessions'); diag('The value ends as: ' . $obj->{'cfg'}->param("paths.sessions")); $obj->_Authenticate(); is($obj->{'s'}->param("~logged-in"),1,'We have successfully logged in. +');
But it would seem that my hesco user ought to be able to write to the session file store, anyway.# The value starts as: /tmp/sessions # The value ends as: /home/hesco/sandbox/My-Project/t/sessions Died attempting to flush session parameters to the file store: Permiss +ion denied at lib/My/Project.pm line 380.
The whole point of the $obj->{'cfg'}->param() call above is to redirect that session creation back into my home directory when this is run from a command line by me, instead of by the apache server.$ sudo ls /tmp -lht drw-rw-r-- 2 hesco www-data 104 2009-08-20 01:09 sessions
Why would my Test::More::diag() tell me I have successfully reset my sessions folder, but that new value becomes unavailable to my $obj->_Authenticate() call?
How can I test this?
-- Hugh
In reply to Config::Simple value lost on method call, huh??? by hesco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |