Re: [Catalyst] about catalyst authentication

2009-04-18 Thread Malloy
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/


Re: [Catalyst] about catalyst authentication

2009-04-18 Thread Simon Wilcox

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

2009-04-18 Thread Malloy
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/;


default_realm dbic



# 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


# 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
   




* 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
___
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

2009-04-18 Thread Malloy
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
___
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

2009-04-18 Thread Devin Austin
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: 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

2009-04-18 Thread Malloy
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: 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

2009-04-18 Thread Devin Austin
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: 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

2009-04-18 Thread Malloy
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: 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

2009-04-18 Thread Malloy
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: 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

2009-04-17 Thread Devin Austin
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: 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

2009-04-17 Thread Andrew Rodland
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/


[Catalyst] about catalyst authentication

2009-04-17 Thread Malloy
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/