Skip to content

Commit

Permalink
Closes #141 "SQLite" backend and Sessions: wrong table, "sessions" be…
Browse files Browse the repository at this point in the history
…ing used?
  • Loading branch information
justingit committed Mar 10, 2011
1 parent cd8b00d commit 14c7b0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions dada/DADA/App/Session.pm
Expand Up @@ -30,6 +30,10 @@ sub _init {
$self->{can_use_cgi_session} = $self->can_use_cgi_session();
$self->{can_use_data_dumper} = $self->can_use_data_dumper();





if($DADA::Config::SESSION_DB_TYPE =~ m/SQL/){
require DADA::App::DBIHandle;
$self->{dbh} = DADA::App::DBIHandle->new->dbh_obj;
Expand Down Expand Up @@ -66,13 +70,9 @@ sub _init {
# http://search.cpan.org/~bmoyles/CGI-Session-SQLite/SQLite.pm
$self->{dsn} = 'driver:SQLite:'; # . ':' . $DADA::Config::FILES . '/' . $database;;
$self->{dsn_args} = {

Handle => $self->{dbh},

TableName => $DADA::Config::SQL_PARAMS{session_table},
};


$CGI::Session::SQLite::TABLE_NAME = 'dada_sessions';
}

}
Expand Down Expand Up @@ -125,11 +125,10 @@ sub login_cookie {

my $cipher_pass = DADA::Security::Password::cipher_encrypt($li->{cipher_key}, $args{-password});


if($self->{can_use_cgi_session} == 1 && $self->{can_use_data_dumper} ==1){


require CGI::Session;
require CGI::Session;
CGI::Session->name($DADA::Config::LOGIN_COOKIE_NAME);


Expand Down Expand Up @@ -193,7 +192,7 @@ sub change_login {
if($self->{can_use_cgi_session} == 1 && $self->{can_use_data_dumper} == 1){

require CGI::Session;
CGI::Session->name($DADA::Config::LOGIN_COOKIE_NAME);
my $old_session = new CGI::Session($self->{dsn}, $q, $self->{dsn_args});

Expand Down
2 changes: 1 addition & 1 deletion dada/DADA/Profile/Session.pm
Expand Up @@ -74,10 +74,10 @@ sub _init {
$self->{dsn_args} = {

Handle => $dbh,
TableName => $DADA::Config::SQL_PARAMS{session_table},

};

$CGI::Session::SQLite::TABLE_NAME = 'dada_sessions';
}
}
elsif ( $DADA::Config::SESSION_DB_TYPE eq 'Db' ) {
Expand Down

0 comments on commit 14c7b0d

Please sign in to comment.