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 <[email protected]>wrote:

> If your data needs to be more persistent save it in the database
>
>

-- 
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/

Reply via email to