A program to identify the players:

$obj->{'q'} isa CGI
$obj->{'cfg'} isa Config::Simple

This is from a test script in my current project:

$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. +');
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:

# 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.
But it would seem that my hesco user ought to be able to write to the session file store, anyway.

$ sudo ls /tmp -lht drw-rw-r-- 2 hesco www-data 104 2009-08-20 01:09 sessions
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.

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

if( $lal && $lol ) { $life++; }

In reply to Config::Simple value lost on method call, huh??? by hesco

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.