Re: [Catalyst] about catalyst authentication
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: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] about catalyst authentication
probably because the session is cleared out On Sat, Apr 18, 2009 at 12:28 AM, Malloy jackwor...@gmail.com wrote: After restart apache, user must login again. I find $c-user_existsis not true. Why? -- Jack Malloy ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ 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! ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] about catalyst authentication
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 arodl...@comcast.netwrote: 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: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ -- Jack Malloy ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] about catalyst authentication
The point is, your sessions are going to be cleared out upon server restart. On Sat, Apr 18, 2009 at 1:10 AM, Malloy jackwor...@gmail.com wrote: Hi Andrew debian:/tmp/qy# ls session_data On Sat, Apr 18, 2009 at 2:52 PM, Andrew Rodland arodl...@comcast.netwrote: 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: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ 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! ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] about catalyst authentication
Yep. but how to fix this problem? On Sat, Apr 18, 2009 at 3:22 PM, Devin Austin devin.aus...@gmail.comwrote: The point is, your sessions are going to be cleared out upon server restart. -- Jack Malloy ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] about catalyst authentication
If your data needs to be more persistent save it in the database On Sat, Apr 18, 2009 at 1:25 AM, Malloy jackwor...@gmail.com wrote: Yep. but how to fix this problem? On Sat, Apr 18, 2009 at 3:22 PM, Devin Austin devin.aus...@gmail.comwrote: The point is, your sessions are going to be cleared out upon server restart. -- Jack Malloy ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ 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! ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] about catalyst authentication
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 devin.aus...@gmail.comwrote: The point is, your sessions are going to be cleared out upon server restart. -- Jack Malloy ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] about catalyst authentication
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 devin.aus...@gmail.comwrote: If your data needs to be more persistent save it in the database -- Jack Malloy ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] about catalyst authentication
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. ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] about catalyst authentication
Thanks all. It's ok now. -- Jack Malloy ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/