FAQ
Hi,

I'm trying to figure out why my sessions are expiring in
script/xxx_cgi.pl but not script/xxx_server.pl
The desired cycle is to login then redirect to another controller.

When I run the standalone server, the session state is recovered, and
control resumes with the next controller.

When I run using Apache & the script/xxx_cgi.pl, the session state is
marked expired and control returns to the login controller.

I'm using the Session, Session::Store::FastMmap, Session::State::Cookie
plugins.

Thanks for your support!

Cheers,
jec

Search Discussions

  • Matt S Trout at May 21, 2007 at 2:46 am

    On Sun, May 20, 2007 at 06:20:23PM -0700, Jeff Chimene wrote:
    Thanks for your support!
    This isn't support, this is heckling with the occasional suggestion. Support
    is what your management pays us for if the heckling gets too much :)

    But anyway, could you show your configs, tell us whether it's the same
    machine and provide fragments of your debug logs please?

    --
    Matt S Trout Need help with your Catalyst or DBIx::Class project?
    Technical Director Want a managed development or deployment platform?
    Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote
    http://chainsawblues.vox.com/ http://www.shadowcatsystems.co.uk/
  • Jeff Chimene at May 21, 2007 at 3:37 am

    Matt S Trout wrote:
    On Sun, May 20, 2007 at 06:20:23PM -0700, Jeff Chimene wrote:
    Thanks for your support!
    This isn't support, this is heckling with the occasional suggestion. Support
    is what your management pays us for if the heckling gets too much :)
    /me tries to avoid athletic supporter analogies.... ;-}
    But anyway, could you show your configs, tell us whether it's the same
    machine and provide fragments of your debug logs please?
    Same machine. I don't know what the attachment or HTML rules are for
    this list. I'm guessing the
    following logs will wrap...

    I'm not sure what the configs can provide, but from the lib/aic.pm:
    __PACKAGE__->config( name => 'aic'
    , static => { include_path => [ '/usr/local'
    , __PACKAGE__->config->{root} ]
    , ignore_extensions => [ qw/tmpl tt tt2/
    );

    I couldn't figure out how to put the __PACKAGE__ reference into YAML
    syntax.
    There is also a YAML file:
    ---
    name: aic
    static:
    no_logs: 0
    imgdir: /var/www/httpdocs/images
    Model::inspect:
    schema_class: aic::inspect
    connect_info:
    - dbi:mysql:database
    - theUsername
    - thePassword
    authentication:
    rdbo:
    user_class: aicDB::Access
    user_field: username
    password_field: password
    authorization:
    rdbo:
    role_rel: roles
    role_field: role

    -------------------------

    Same machine. Here is the log when using script/aic_server.pl:

    $ script/aic_server.pl
    [debug] Debug messages enabled
    [debug] Loaded plugins:
    .----------------------------------------------------------------------------.
    Catalyst::Plugin::Authentication
    0.09 |

    Catalyst::Plugin::Authentication::Credential::Password |
    Catalyst::Plugin::Authentication::Store::RDBO
    0.002 |
    Catalyst::Plugin::Authorization::ACL
    0.08 |
    Catalyst::Plugin::Authorization::Roles
    0.05 |
    Catalyst::Plugin::ConfigLoader
    0.14 |
    Catalyst::Plugin::Session
    0.14 |
    Catalyst::Plugin::Session::State::Cookie
    0.07 |
    Catalyst::Plugin::Session::Store::FastMmap
    0.02 |
    Catalyst::Plugin::StackTrace
    0.06 |
    Catalyst::Plugin::Static::Simple
    0.17 |
    '----------------------------------------------------------------------------'

    [debug] Loaded dispatcher "Catalyst::Dispatcher"
    [debug] Loaded engine "Catalyst::Engine::HTTP"
    [debug] Found home "/home/jchimene/aic"
    [debug] Loaded Config "/home/jchimene/aic/aic.yml"
    [debug] Loaded components:
    .-----------------------------------------------------------------+----------.
    Class |
    Type |
    +-----------------------------------------------------------------+----------+
    aic::Controller::Editor |
    instance |
    aic::Controller::Login |
    instance |
    aic::Controller::Root |
    instance |
    aic::Model::Access |
    instance |
    aic::Model::Editor |
    instance |
    aic::Model::inspectDB |
    class |
    aic::Model::inspectDB::__RoseDBPrivate__::Rose::DB::MySQL |
    class |
    aic::View::Editor |
    instance |
    aic::View::Login |
    instance |
    '-----------------------------------------------------------------+----------'

    [debug] Loaded Private actions:
    .----------------------+--------------------------------------+--------------.
    Private | Class |
    Method |
    +----------------------+--------------------------------------+--------------+
    /default | aic::Controller::Root |
    default |
    /end | aic::Controller::Root |
    end |
    /acl_access_denied | aic |
    acl_access_- |
    denied |
    /auto | aic::Controller::Root |
    auto |
    /editor/postCaption- | aic::Controller::Editor |
    postCaption- |
    Handler | |
    Handler |
    /editor/postFileHan- | aic::Controller::Editor |
    postFileHan- |
    dler | |
    dler |
    /editor/default | aic::Controller::Editor |
    default |
    /editor/access_deni- | aic::Controller::Editor |
    access_deni- |
    ed | |
    ed |
    /editor/index | aic::Controller::Editor |
    index |
    /login/index | aic::Controller::Login |
    index |
    '----------------------+--------------------------------------+--------------'

    [debug] Loaded Path actions:
    .-------------------------------------+--------------------------------------.
    Path |
    Private |
    +-------------------------------------+--------------------------------------+
    /editor/postCaptionHandler |
    /editor/postCaptionHandler |
    /editor/postFileHandler |
    /editor/postFileHandler |
    '-------------------------------------+--------------------------------------'

    [info] aic powered by Catalyst 5.7007
    You can connect to your server at http://anode:3000
    [info] *** Request 1 (0.038/s) [11291] [Sun May 20 19:10:15 2007] ***
    [debug] "GET" request for "login" from "192.168.1.101"
    [debug] Path is "login"
    [debug] sending login template...
    [debug] Rendering template "login.tt2"
    [debug] Applying HTML page layout wrappers to login.tt2
    [info] Request took 0.208960s (4.786/s)
    .----------------------------------------------------------------+-----------.
    Action |
    Time |
    +----------------------------------------------------------------+-----------+
    /auto |
    0.000252s |
    /login/index |
    0.003605s |
    /end |
    0.184050s |
    -> aic::View::Editor->process |
    0.181241s |
    '----------------------------------------------------------------+-----------'

    [info] *** Request 2 (0.037/s) [11291] [Sun May 20 19:10:43 2007] ***
    [debug] Body Parameters are:
    .-------------------------------------+--------------------------------------.
    Parameter |
    Value |
    +-------------------------------------+--------------------------------------+
    password | thePassword

    username |
    theUsername |
    '-------------------------------------+--------------------------------------'
    [debug] "POST" request for "login" from "192.168.1.101"
    [debug] Path is "login"
    [debug] Created session "ff89eff91811558e9b9d1b71b5dcf9b9ba7f3f12"
    [debug] Successfully authenticated user 'theUsername'.
    [debug] Found name: Fred Fubar
    [debug] Redirecting to "http://anode:3000/editor"
    [info] Request took 0.064471s (15.511/s)
    .----------------------------------------------------------------+-----------.
    Action |
    Time |
    +----------------------------------------------------------------+-----------+
    /auto |
    0.000252s |
    /login/index |
    0.042130s |
    -> aic::Model::Access->SetSession |
    0.013181s |
    /end |
    0.000341s |
    '----------------------------------------------------------------+-----------'
    [**********

    The above call to /login/index employs $c->user_exists(); which function
    returns TRUE, therefore we load the user information via the Model

    ***********]

    [info] *** Request 3 (0.042/s) [11291] [Sun May 20 19:11:00 2007] ***
    [debug] "GET" request for "editor" from "192.168.1.101"
    [debug] Path is "editor"
    [debug] Found sessionid "ff89eff91811558e9b9d1b71b5dcf9b9ba7f3f12" in cookie
    [debug] Restored session "ff89eff91811558e9b9d1b71b5dcf9b9ba7f3f12"
    [debug] Rendering template "editor.tt2"
    [debug] Applying HTML page layout wrappers to editor.tt2
    [info] Request took 0.057614s (17.357/s)
    .----------------------------------------------------------------+-----------.
    Action |
    Time |
    +----------------------------------------------------------------+-----------+
    /auto |
    0.002992s |
    /editor/index |
    0.000485s |
    /end |
    0.034371s |
    -> aic::View::Editor->process |
    0.031687s |
    '----------------------------------------------------------------+-----------'

    [%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%]

    All is goodness.

    Here is the same sequence via Apache. The "Loaded..." messages have
    been snipped.

    [%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%]

    [debug] Debug messages enabled
    [debug] Loaded plugins:
    <SNIP>
    [debug] Loaded dispatcher "Catalyst::Dispatcher"
    [debug] Loaded engine "Catalyst::Engine::CGI"
    [debug] Found home "/home/jchimene/aic"
    [debug] Loaded Config "/home/jchimene/aic/aic.yml"
    [debug] Loaded components:
    <SNIP>
    [debug] Loaded Private actions:
    <SNIP>
    [debug] Loaded Path actions:
    <SNIP>
    [info] aic powered by Catalyst 5.7007
    [info] *** Request 1 (1.000/s) [11342] [Sun May 20 19:18:09 2007] ***
    [debug] "GET" request for "login" from "192.168.1.101"
    [debug] Path is "login"
    [debug] Found sessionid "ff89eff91811558e9b9d1b71b5dcf9b9ba7f3f12" in cookie
    [debug] Deleting session(session expired)
    [debug] sending login template...
    [debug] Rendering template "login.tt2"
    [debug] Applying HTML page layout wrappers to login.tt2
    [info] Request took 0.206035s (4.854/s)
    .----------------------------------------------------------------+-----------.
    Action |
    Time |
    +----------------------------------------------------------------+-----------+
    /auto |
    0.000269s |
    /login/index |
    0.003596s |
    /end |
    0.181393s |
    -> aic::View::Editor->process |
    0.178662s |
    '----------------------------------------------------------------+-----------'

    [debug] Debug messages enabled, referer: http://anode:4000/aic/login
    [debug] Loaded plugins:, referer: http://anode:4000/aic/login

    [
    clue? The following messages are all suffixed ", referer:
    http://anode:4000/aic/login"
    I've snipped the repeating text.
    ]

    <SNIP>
    [debug] Loaded dispatcher "Catalyst::Dispatcher", referer:
    http://anode:4000/aic/login
    [debug] Loaded engine "Catalyst::Engine::CGI"
    [debug] Found home "/home/jchimene/aic"
    [debug] Loaded Config "/home/jchimene/aic/aic.yml"
    [debug] Loaded components:
    <SNIP>

    [debug] Loaded Private actions:
    <SNIP>
    [debug] Loaded Path actions:
    <SNIP>
    [info] aic powered by Catalyst 5.7007
    [info] *** Request 1 (1.000/s) [11343] [Sun May 20 19:18:14 2007] ***
    [debug] Body Parameters are:
    .-------------------------------------+--------------------------------------.
    Parameter |
    Value |
    +-------------------------------------+--------------------------------------+
    password | thePassword

    username | theUsername
    '-------------------------------------+--------------------------------------'
    [debug] "POST" request for "login" from "192.168.1.101"
    [debug] Path is "login"
    [debug] Created session "a3c303b1b013700593af7ddc7fc4b54dbe441bec"
    [debug] Successfully authenticated user 'theUsername'.
    [debug] Found name: Fred Fubar
    [debug] Redirecting to "http://anode:4000/aic/editor"
    [info] Request took 0.068615s (14.574/s)
    .----------------------------------------------------------------+-----------.
    Action |
    Time |
    +----------------------------------------------------------------+-----------+
    /auto |
    0.000250s |
    /login/index |
    0.042520s |
    -> aic::Model::Access->SetSession |
    0.013193s |
    /end |
    0.000324s |
    '----------------------------------------------------------------+-----------'

    [debug] Debug messages enabled
    [debug] Loaded plugins:
    <SNIP>
    [debug] Loaded dispatcher "Catalyst::Dispatcher"
    [debug] Loaded engine "Catalyst::Engine::CGI"
    [debug] Found home "/home/jchimene/aic"
    [debug] Loaded Config "/home/jchimene/aic/aic.yml"
    [debug] Loaded components:
    <SNIP>
    [debug] Loaded Private actions:
    <SNIP>
    [debug] Loaded Path actions:
    <SNIP>
    [info] aic powered by Catalyst 5.7007
    [info] *** Request 1 (1.000/s) [11345] [Sun May 20 19:18:16 2007] ***
    [debug] "GET" request for "editor" from "192.168.1.101"
    [debug] Path is "editor"
    [debug] Found sessionid "a3c303b1b013700593af7ddc7fc4b54dbe441bec" in cookie
    [debug] Deleting session(session expired)
    [debug] Created session "03b53b2ea1c834341f5230ade7b4988641f8f13e"
    [debug] Deleting session(session expired)
    [debug] ***Root::auto User not found, forwarding to /login
    [debug] Created session "0db3f2bc845c3dfbb1f6692b8213361eb56e6921"
    [debug] sending login template...
    [debug] Rendering template "login.tt2"
    [debug] Applying HTML page layout wrappers to login.tt2
    [info] Request took 0.226073s (4.423/s)
    .----------------------------------------------------------------+-----------.
    Action |
    Time |
    +----------------------------------------------------------------+-----------+
    /auto |
    0.018829s |
    -> aic::Controller::Login->index |
    0.000666s |
    /end |
    0.183345s |
    -> aic::View::Editor->process |
    0.180805s |
    '----------------------------------------------------------------+-----------'
  • Thomas L. Shinnick at May 21, 2007 at 3:36 am

    At 08:20 PM 5/20/2007, Jeff Chimene wrote:
    Hi,
    I'm trying to figure out why my sessions are expiring in
    script/xxx_cgi.pl but not script/xxx_server.pl [snip]
    I'm using the Session, Session::Store::FastMmap,
    Session::State::Cookie plugins.
    I've not used it, I'm guessing, and I'm an idiot, but isn't this
    likely permissions problems, between running standalone vs. running
    under Apache? Any chance the backing storage file is not available
    to Apache processes? Peeking at the docs:
    storage
    Specifies the file to be used for the sharing of session data. ...
    Note that the file will be created with mode 0640, which means that
    it will only be writeable by processes running with the same uid as
    the process that creates the file. ....

    Try deleting the backing file before re-running under Apache?
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070520/743b0dba/attachment.htm
  • Jeff Chimene at May 21, 2007 at 4:13 am

    Thomas L. Shinnick wrote:
    At 08:20 PM 5/20/2007, Jeff Chimene wrote:
    Hi,
    I'm trying to figure out why my sessions are expiring in
    script/xxx_cgi.pl but not script/xxx_server.pl [snip]
    I'm using the Session, Session::Store::FastMmap,
    Session::State::Cookie plugins.
    I've not used it, I'm guessing, and I'm an idiot, but isn't this
    likely permissions problems, between running standalone vs. running
    under Apache? Any chance the backing storage file is not available to
    Apache processes? Peeking at the docs:
    storage
    Specifies the file to be used for the sharing of session
    data. ...
    Note that the file will be created with mode 0640, which means
    that
    it will only be writeable by processes running with the same
    uid as
    the process that creates the file. ....

    Try deleting the backing file before re-running under Apache?
    Good catch. Apache (or script/aic_server.pl) refuses to honor a request
    if the working storage file created by the other HTTP server exists. I
    couldn't even get started w/o a preliminary "sudo rm -r /tmp/aic" So,
    although that's /a/ problem, it's not /the/ problem.

    Cheers,
    jec
  • Wade Stuart at May 21, 2007 at 5:11 pm

    Jeff Chimene wrote on 05/20/2007 10:13:33 PM:

    Thomas L. Shinnick wrote:
    At 08:20 PM 5/20/2007, Jeff Chimene wrote:
    Hi,
    I'm trying to figure out why my sessions are expiring in
    script/xxx_cgi.pl but not script/xxx_server.pl [snip]
    I'm using the Session, Session::Store::FastMmap,
    Session::State::Cookie plugins.
    I've not used it, I'm guessing, and I'm an idiot, but isn't this
    likely permissions problems, between running standalone vs. running
    under Apache? Any chance the backing storage file is not available to
    Apache processes? Peeking at the docs:
    storage
    Specifies the file to be used for the sharing of session
    data. ...
    Note that the file will be created with mode 0640, which means
    that
    it will only be writeable by processes running with the same
    uid as
    the process that creates the file. ....

    Try deleting the backing file before re-running under Apache?
    Good catch. Apache (or script/aic_server.pl) refuses to honor a request
    if the working storage file created by the other HTTP server exists. I
    couldn't even get started w/o a preliminary "sudo rm -r /tmp/aic" So,
    although that's /a/ problem, it's not /the/ problem.
    Without more info (you will post the info Matt asked for?) this still
    seems like the best candidate for the issue. If you are running on Linux
    and have selinux turned on, another common issue is that your policy does
    not allow promiscuous writes from apache. You may verify this is or is not
    the issue by running audit2why < /var/log/audit/audit.log (or wherever your
    se auditlog is located) and noting any blocks that are happening via your
    web server process.

    Also you may want to force the directory for the session stuffs to a sane
    location ( don't know if you are or not -- you will post the info that Matt
    asked for?).

    -Wade
  • Jeff Chimene at May 21, 2007 at 5:56 pm

    Wade.Stuart@fallon.com wrote:

    Jeff Chimene <jchimene@gmail.com> wrote on 05/20/2007 10:13:33 PM:

    Thomas L. Shinnick wrote:
    At 08:20 PM 5/20/2007, Jeff Chimene wrote:

    Hi,
    I'm trying to figure out why my sessions are expiring in
    script/xxx_cgi.pl but not script/xxx_server.pl [snip]
    I'm using the Session, Session::Store::FastMmap,
    Session::State::Cookie plugins.
    I've not used it, I'm guessing, and I'm an idiot, but isn't this
    likely permissions problems, between running standalone vs. running
    under Apache? Any chance the backing storage file is not available to
    Apache processes? Peeking at the docs:
    storage
    Specifies the file to be used for the sharing of session
    data. ...
    Note that the file will be created with mode 0640, which means
    that
    it will only be writeable by processes running with the same
    uid as
    the process that creates the file. ....

    Try deleting the backing file before re-running under Apache?
    Good catch. Apache (or script/aic_server.pl) refuses to honor a request
    if the working storage file created by the other HTTP server exists. I
    couldn't even get started w/o a preliminary "sudo rm -r /tmp/aic" So,
    although that's /a/ problem, it's not /the/ problem.
    Without more info (you will post the info Matt asked for?)
    Posted yesterday:
    http://www.mail-archive.com/catalyst@lists.rawmode.org/msg05448.html
    this still seems like the best candidate for the issue.
    Ibid. This isn't the problem
    If you are running on Linux
    and have selinux turned on, another common issue is that your policy does
    not allow promiscuous writes from apache.
    Debian Etch
    You may verify this is or is not
    the issue by running audit2why < /var/log/audit/audit.log (or wherever your
    se auditlog is located) and noting any blocks that are happening via yourweb server process.

    Also you may want to force the directory for the session stuffs to a sane
    location ( don't know if you are or not -- you will post the info that Matt
    asked for?).
    Ibid.

    I've posted this A.M. w/r/t disabling auto() in Root.pm:
    http://www.mail-archive.com/catalyst@lists.rawmode.org/msg05457.html

    Cheers,.
    jec
  • Jeff Chimene at May 21, 2007 at 4:52 pm

    Jeff Chimene wrote:
    Hi,

    I'm trying to figure out why my sessions are expiring in
    script/xxx_cgi.pl but not script/xxx_server.pl
    The desired cycle is to login then redirect to another controller.

    When I run the standalone server, the session state is recovered, and
    control resumes with the next controller.

    When I run using Apache & the script/xxx_cgi.pl, the session state is
    marked expired and control returns to the login controller.

    I'm using the Session, Session::Store::FastMmap, Session::State::Cookie
    plugins.

    Thanks for your support!

    Cheers,
    jec
    This has something to do w/ the implementation of the "auto" method in
    Root.pm

    There's some "extra" stuff I added to support returning to the requested
    URI after
    login. Nevertheless, it works from script/aic_server.pl, but not from
    Apache.

    Anyway, I disabled the routine and received goodness from Apache.

    sub auto : Private
    {
    my ($self, $c) = @_;

    if ($c->controller eq $c->controller('Login')) {
    return 1;
    }

    # If a user doesn't exist, force login
    $c->session->{after_login} = '';
    if (!$c->user_exists) {
    $c->log->debug('***Root::auto User not found, forwarding to
    /login') if $c->debug;

    # make sure we return here after a successful login
    $c->session->{after_login} = $c->request->uri() unless
    ($c->request->uri() eq $c->request->base());
    $c->detach('aic::Controller::Login', 'index');
    }

    # User found, so return 1 to continue with processing after this 'auto'
    return 1;
    }
  • James R. Leu at May 21, 2007 at 5:28 pm
    Not really related to your issue specifically, but I have seen
    issues with using Session::Store::FastMmap and perl ithreads resulting
    in unrelated sessions appearing to terminate when a thread 'joins'
    back to the parent. I think is has something to do with ithreads
    interaction with shared memory. My fix was to not use shared memory :-)
    On Mon, May 21, 2007 at 08:52:16AM -0700, Jeff Chimene wrote:
    Jeff Chimene wrote:
    Hi,

    I'm trying to figure out why my sessions are expiring in
    script/xxx_cgi.pl but not script/xxx_server.pl
    The desired cycle is to login then redirect to another controller.

    When I run the standalone server, the session state is recovered, and
    control resumes with the next controller.

    When I run using Apache & the script/xxx_cgi.pl, the session state is
    marked expired and control returns to the login controller.

    I'm using the Session, Session::Store::FastMmap, Session::State::Cookie
    plugins.

    Thanks for your support!

    Cheers,
    jec
    This has something to do w/ the implementation of the "auto" method in
    Root.pm

    There's some "extra" stuff I added to support returning to the requested
    URI after
    login. Nevertheless, it works from script/aic_server.pl, but not from
    Apache.

    Anyway, I disabled the routine and received goodness from Apache.

    sub auto : Private
    {
    my ($self, $c) = @_;

    if ($c->controller eq $c->controller('Login')) {
    return 1;
    }

    # If a user doesn't exist, force login
    $c->session->{after_login} = '';
    if (!$c->user_exists) {
    $c->log->debug('***Root::auto User not found, forwarding to
    /login') if $c->debug;

    # make sure we return here after a successful login
    $c->session->{after_login} = $c->request->uri() unless
    ($c->request->uri() eq $c->request->base());
    $c->detach('aic::Controller::Login', 'index');
    }

    # User found, so return 1 to continue with processing after this 'auto'
    return 1;
    }


    _______________________________________________
    List: Catalyst@lists.rawmode.org
    Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
    Dev site: http://dev.catalyst.perl.org/
    --
    James R. Leu
    jleu@mindspring.com
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: not available
    Type: application/pgp-signature
    Size: 189 bytes
    Desc: not available
    Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070521/6a66d714/attachment.pgp
  • Jeff Chimene at May 21, 2007 at 6:00 pm

    James R. Leu wrote:
    Not really related to your issue specifically, but I have seen
    issues with using Session::Store::FastMmap and perl ithreads resulting
    in unrelated sessions appearing to terminate when a thread 'joins'
    back to the parent. I think is has something to do with ithreads
    interaction with shared memory. My fix was to not use shared memory :-)
    OK, but this is a development machine, and I'm the only user. AFAIK, I'm
    not using ithreads. As I mentioned, disabling the auto() method in
    Root.pm seems to have solved the issue:
    http://www.mail-archive.com/catalyst@lists.rawmode.org/msg05457.html

    Cheers,
    jec
    On Mon, May 21, 2007 at 08:52:16AM -0700, Jeff Chimene wrote:

    Jeff Chimene wrote:
    Hi,

    I'm trying to figure out why my sessions are expiring in
    script/xxx_cgi.pl but not script/xxx_server.pl
    The desired cycle is to login then redirect to another controller.

    When I run the standalone server, the session state is recovered, and
    control resumes with the next controller.

    When I run using Apache & the script/xxx_cgi.pl, the session state is
    marked expired and control returns to the login controller.

    I'm using the Session, Session::Store::FastMmap, Session::State::Cookie
    plugins.

    Thanks for your support!

    Cheers,
    jec
    This has something to do w/ the implementation of the "auto" method in
    Root.pm

    There's some "extra" stuff I added to support returning to the requested
    URI after
    login. Nevertheless, it works from script/aic_server.pl, but not from
    Apache.

    Anyway, I disabled the routine and received goodness from Apache.

    sub auto : Private
    {
    my ($self, $c) = @_;

    if ($c->controller eq $c->controller('Login')) {
    return 1;
    }

    # If a user doesn't exist, force login
    $c->session->{after_login} = '';
    if (!$c->user_exists) {
    $c->log->debug('***Root::auto User not found, forwarding to
    /login') if $c->debug;

    # make sure we return here after a successful login
    $c->session->{after_login} = $c->request->uri() unless
    ($c->request->uri() eq $c->request->base());
    $c->detach('aic::Controller::Login', 'index');
    }

    # User found, so return 1 to continue with processing after this 'auto'
    return 1;
    }
  • Jeff Chimene at May 23, 2007 at 4:24 pm

    Jeff Chimene wrote:
    Hi,

    I'm trying to figure out why my sessions are expiring in
    script/xxx_cgi.pl but not script/xxx_server.pl
    The desired cycle is to login then redirect to another controller.

    When I run the standalone server, the session state is recovered, and
    control resumes with the next controller.

    When I run using Apache & the script/xxx_cgi.pl, the session state is
    marked expired and control returns to the login controller.

    I'm using the Session, Session::Store::FastMmap, Session::State::Cookie
    plugins.

    Thanks for your support!

    Cheers,
    jec
    More breadcrumbs. The directory is getting created, but session_data
    isn't getting created.
  • Alexandre Jousset at May 23, 2007 at 4:43 pm
    Hi,

    Jeff Chimene wrote:
    More breadcrumbs. The directory is getting created, but session_data
    isn't getting created.
    I have similar problem... The symptom is that the directory is created
    with the wrong user (root). Each time I reboot the server I have to
    manually ? chown www-data:www-data ? the directory (don't remember its
    name). As you may have guessed, for the moment the directory is in /tmp
    (which content is deleted at each reboot).

    I don't care I am not in prod but I think if you specially create a dir
    somewhere else in your FS with good owner and configure Session to use
    it, everything should be OK.

    Maybe it's not the same bug (is it a bug?). My 2p.

    Regards,
    --
    -- \^/ --
    -- -/ O \--------------------------------------- --
    -- | |/ \| Alexandre (Midnite) Jousset | --
    -- -|___|--------------------------------------- --
  • Jeff Chimene at May 23, 2007 at 4:44 pm

    Jeff Chimene wrote:
    Hi,

    I'm trying to figure out why my sessions are expiring in
    script/xxx_cgi.pl but not script/xxx_server.pl
    The desired cycle is to login then redirect to another controller.

    When I run the standalone server, the session state is recovered, and
    control resumes with the next controller.

    When I run using Apache & the script/xxx_cgi.pl, the session state is
    marked expired and control returns to the login controller.

    I'm using the Session, Session::Store::FastMmap, Session::State::Cookie
    plugins.

    Thanks for your support!

    Cheers,
    jec
    The issue was that I had removed 'libcache-fastmmap-perl' (Debian Etch)
    and installed the version from CPAN. The pure CPAN version doesn't play
    well on Debian. I removed the CPAN version of File::CacheMmap, installed
    the Debian Etch version, and Apache created the session_data file. I'll
    contact the Debian maintainer and see if there's any interest in
    explaining the discrepancy.

    FWIW, I'm not thrilled w/ Debianized Perl modules; I've been attempting
    to migrate away from Debianized Perl to CPAN only. There may be some
    inherent limitations in that approach.

    Cheers,
    jec
  • Jeff Chimene at May 23, 2007 at 5:12 pm

    Jeff Chimene wrote:
    Jeff Chimene wrote:
    Hi,

    I'm trying to figure out why my sessions are expiring in
    script/xxx_cgi.pl but not script/xxx_server.pl
    The desired cycle is to login then redirect to another controller.

    When I run the standalone server, the session state is recovered, and
    control resumes with the next controller.

    When I run using Apache & the script/xxx_cgi.pl, the session state is
    marked expired and control returns to the login controller.

    I'm using the Session, Session::Store::FastMmap, Session::State::Cookie
    plugins.

    Thanks for your support!

    Cheers,
    jec
    The issue was that I had removed 'libcache-fastmmap-perl' (Debian Etch)
    and installed the version from CPAN. The pure CPAN version doesn't play
    well on Debian. I removed the CPAN version of File::CacheMmap
    Cache::FastMmap
  • Jamie Neil at May 23, 2007 at 5:49 pm

    Jeff Chimene wrote:
    FWIW, I'm not thrilled w/ Debianized Perl modules; I've been attempting
    to migrate away from Debianized Perl to CPAN only. There may be some
    inherent limitations in that approach.
    I've been trying to go the other way and install as little as possible
    from CPAN. For those situations where Debian doesn't have it, or I need
    a newer version than the Debian one, I use dh-make-perl.

    Works straight from CPAN most of the time, but sometimes you need to
    download first and hack the Makefile a bit.

    --
    Jamie Neil | <jamie@versado.net> | 0870 7777 454
    Versado I.T. Services Ltd. | http://versado.net/ | 0845 450 1254
  • Jeff Chimene at May 23, 2007 at 6:11 pm

    Jamie Neil wrote:
    Jeff Chimene wrote:
    FWIW, I'm not thrilled w/ Debianized Perl modules; I've been attempting
    to migrate away from Debianized Perl to CPAN only. There may be some
    inherent limitations in that approach.
    I've been trying to go the other way and install as little as possible
    from CPAN.
    Why? My particular reason is Debian's release cycle; which reason may be
    more of an assumption than reality. I have not compared CPAN package
    release dates to Debian dates.
    For those situations where Debian doesn't have it, or I need a newer
    version than the Debian one, I use dh-make-perl.
    I'll check dh-make-perl. That might render the above reason moot.
    Works straight from CPAN most of the time, but sometimes you need to
    download first and hack the Makefile a bit.
    Thanks for the heads-up.

    Cheers,
    jec

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedMay 21, '07 at 2:20a
activeMay 23, '07 at 6:11p
posts16
users7
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase