FAQ
After restart apache, user must login again. I find $c->user_existsis not
true.

Why?


--
Jack Malloy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090418/f15d7157/attachment.htm

Search Discussions

  • Andrew Rodland at Apr 18, 2009 at 6:52 am

    On Saturday 18 April 2009 01:28:30 am Malloy wrote:
    After restart apache, user must login again. I find $c->user_existsis not
    true.

    Why?
    Because you're using Session::Store::FastMmap and the session cache file
    didn't exist before your app started, so Cache::FastMmap deletes it on exit?

    Andrew
  • Malloy at Apr 18, 2009 at 7:02 am
    Thanks. I think so, too. But why Cache::FastMmap deletes it? Where can set
    it?

    I just use all config default.

    use Catalyst qw/-Debug
    ConfigLoader::MultiState
    Static::Simple

    StackTrace
    Authentication

    Session
    Session::Store::FastMmap
    Session::State::Cookie/;

    Plugin-Authentication.conf:

    $default_realm = 'default';
    $realms = {
    'default' => {
    'credential' => {
    'class' => 'Password',
    'password_field' => 'password',
    'password_type' => 'hashed',
    'password_hash_type' => 'MD5',
    },
    'store' => {
    'class' => 'DBI',
    'user_table' => 'qy_user',
    'user_key' => 'id',
    'user_name' => 'username',
    'user_password' => 'password',
    },
    },
    };

    $use_session = 1;


    On Sat, Apr 18, 2009 at 2:52 PM, Andrew Rodland wrote:
    On Saturday 18 April 2009 01:28:30 am Malloy wrote:
    After restart apache, user must login again. I find $c->user_existsis not
    true.

    Why?
    Because you're using Session::Store::FastMmap and the session cache file
    didn't exist before your app started, so Cache::FastMmap deletes it on
    exit?

    Andrew



    _______________________________________________
    List: [email protected]
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/[email protected]/
    Dev site: http://dev.catalyst.perl.org/


    --
    Jack Malloy
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090418/35e465b8/attachment.htm
  • Malloy at Apr 18, 2009 at 7:10 am
    Hi Andrew

    debian:/tmp/qy# ls
    session_data

    On Sat, Apr 18, 2009 at 2:52 PM, Andrew Rodland wrote:
    On Saturday 18 April 2009 01:28:30 am Malloy wrote:
    After restart apache, user must login again. I find $c->user_existsis not
    true.

    Why?
    Because you're using Session::Store::FastMmap and the session cache file
    didn't exist before your app started, so Cache::FastMmap deletes it on
    exit?

    Andrew

    --
    Jack Malloy
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090418/8ceda1e9/attachment.htm
  • Devin Austin at Apr 18, 2009 at 7:22 am
    The point is, your sessions are going to be cleared out upon server restart.
    On Sat, Apr 18, 2009 at 1:10 AM, Malloy wrote:

    Hi Andrew

    debian:/tmp/qy# ls
    session_data


    On Sat, Apr 18, 2009 at 2:52 PM, Andrew Rodland wrote:
    On Saturday 18 April 2009 01:28:30 am Malloy wrote:
    After restart apache, user must login again. I find $c->user_existsis not
    true.

    Why?
    Because you're using Session::Store::FastMmap and the session cache file
    didn't exist before your app started, so Cache::FastMmap deletes it on
    exit?

    Andrew

    --
    Jack Malloy

    _______________________________________________
    List: [email protected]
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/[email protected]/
    Dev site: http://dev.catalyst.perl.org/

    --
    Devin Austin
    http://www.codedright.net
    http://www.dreamhost.com/r.cgi?326568/hosting.html - Host with DreamHost!
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090418/6a731cf1/attachment.htm
  • Malloy at Apr 18, 2009 at 7:25 am
    Yep. but how to fix this problem?

    On Sat, Apr 18, 2009 at 3:22 PM, Devin Austin wrote:

    The point is, your sessions are going to be cleared out upon server
    restart.

    --
    Jack Malloy
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090418/ffced33d/attachment.htm
  • Devin Austin at Apr 18, 2009 at 7:36 am
    If your data needs to be more persistent save it in the database
    On Sat, Apr 18, 2009 at 1:25 AM, Malloy wrote:

    Yep. but how to fix this problem?


    On Sat, Apr 18, 2009 at 3:22 PM, Devin Austin wrote:

    The point is, your sessions are going to be cleared out upon server
    restart.

    --
    Jack Malloy

    _______________________________________________
    List: [email protected]
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/[email protected]/
    Dev site: http://dev.catalyst.perl.org/

    --
    Devin Austin
    http://www.codedright.net
    http://www.dreamhost.com/r.cgi?326568/hosting.html - Host with DreamHost!
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090418/2d694216/attachment.htm
  • Malloy at Apr 18, 2009 at 8:00 am
    I think something is wrong. Please check:

    I have two apps wc and qy:

    * WC:*

    debian:/tmp/wc# /etc/init.d/apache2 start
    Starting web server: apache2.
    debian:/tmp/wc# ls
    session_data
    debian:/tmp/wc# /etc/init.d/apache2 stop
    Stopping web server: apache2 ... waiting .
    debian:/tmp/wc# ls
    session_data

    *The session_data is there and user needn't login again.*

    use Catalyst qw/-Debug
    ConfigLoader
    Static::Simple

    StackTrace
    Authentication

    Session
    Session::Store::FastMmap
    Session::State::Cookie/;

    <authentication>
    default_realm dbic
    <realms>
    <dbic>
    <credential>
    # Note: this first definition would be the same as setting
    # __PACKAGE__->config->{authentication}->{realms}->{dbic}
    # ->{credential} = 'Password' in lib/MyApp.pm
    #
    # Specify that we are going to do password-based auth
    class Password
    # This is the name of the field in the users table with the
    # password stored in it
    password_field password
    # Switch to more secure hashed passwords
    password_type hashed
    # Use the MD5 hashing algorithm
    password_hash_type MD5
    </credential>
    <store>
    # Use DBIC to retrieve username, password & role information
    * class DBIx::Class*
    # This is the model object created by Catalyst::Model::DBIC
    # from your schema (you created
    'MyApp::Schema::Result::User'
    # but as the Catalyst startup debug messages show, it was
    # loaded as 'MyApp::Model::DB::Users').
    # NOTE: Omit 'MyApp::Model' here just as you would when
    using
    # '$c->model("DB::Users)'
    user_class WCDB::WcUser
    </store>
    </dbic>
    </realms>
    </authentication>

    * QY:*

    debian:/tmp/qy# /etc/init.d/apache2 start
    Starting web server: apache2.
    debian:/tmp/qy# ls
    session_data
    debian:/tmp/qy# /etc/init.d/apache2 stop
    Stopping web server: apache2 ... waiting .
    debian:/tmp/qy# ls
    debian:/tmp/qy#
    *
    The session_data is cleared out and user must login again.

    *use Catalyst qw/-Debug
    ConfigLoader::MultiState
    Static::Simple

    StackTrace
    Authentication

    Session
    Session::Store::FastMmap
    Session::State::URI
    Session::State::Cookie/;

    $default_realm = 'default';
    $realms = {
    'default' => {
    'credential' => {
    'class' => 'Password',
    'password_field' => 'password',
    'password_type' => 'hashed',
    'password_hash_type' => 'MD5',
    },
    'store' => {
    * 'class' => 'DBI',*
    'user_table' => 'qy_user',
    'user_key' => 'id',
    'user_name' => 'username',
    'user_password' => 'password',
    },
    },
    };

    $use_session = 1;

    On Sat, Apr 18, 2009 at 3:36 PM, Devin Austin wrote:

    If your data needs to be more persistent save it in the database
    --
    Jack Malloy
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090418/6e147c22/attachment.htm
  • Simon Wilcox at Apr 18, 2009 at 8:29 am

    On 18/4/09 09:00, Malloy wrote:
    I think something is wrong. Please check:
    Read the docs.

    http://search.cpan.org/~robm/Cache-FastMmap-1.28/FastMmap.pm

    If the share_file exists when the process starts it won't be deleted on
    exit. If it doesn't exist the default is to delete it when the process
    exits.

    If you want to be sure of it existing pass undelete_on_exit => 0 to the
    constructor.

    S.
  • Malloy at Apr 18, 2009 at 9:19 am
    Thanks all.

    It's ok now.

    --
    Jack Malloy
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090418/1407e593/attachment.htm
  • Malloy at Apr 18, 2009 at 7:36 am
    I find:

    debian:/tmp/qy# ls
    session_data
    debian:/tmp/qy# /etc/init.d/apache2 stop
    Stopping web server: apache2 ... waiting .
    debian:/tmp/qy# ls
    debian:/tmp/qy#

    The session file is cleared out when apache stop.

    How to fix this problem?

    On Sat, Apr 18, 2009 at 3:22 PM, Devin Austin wrote:

    The point is, your sessions are going to be cleared out upon server
    restart.

    --
    Jack Malloy
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090418/3009154d/attachment.htm
  • Devin Austin at Apr 18, 2009 at 6:53 am
    probably because the session is cleared out
    On Sat, Apr 18, 2009 at 12:28 AM, Malloy wrote:

    After restart apache, user must login again. I find $c->user_existsis not
    true.

    Why?


    --
    Jack Malloy

    _______________________________________________
    List: [email protected]
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/[email protected]/
    Dev site: http://dev.catalyst.perl.org/

    --
    Devin Austin
    http://www.codedright.net
    http://www.dreamhost.com/r.cgi?326568/hosting.html - Host with DreamHost!
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090418/6abefc29/attachment.htm

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedApr 18, '09 at 6:28a
activeApr 18, '09 at 9:19a
posts12
users4
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2023 Grokbase