Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 78737 invoked from network); 21 Dec 2005 09:55:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Dec 2005 09:55:41 -0000 Received: (qmail 94756 invoked by uid 500); 21 Dec 2005 09:55:31 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 94747 invoked by uid 500); 21 Dec 2005 09:55:30 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Delivered-To: moderator for modperl@perl.apache.org Received: (qmail 76265 invoked by uid 99); 19 Dec 2005 15:41:32 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) In-Reply-To: <20051218211106.94554.qmail@web60420.mail.yahoo.com> References: <20051218211106.94554.qmail@web60420.mail.yahoo.com> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: modperl@perl.apache.org Content-Transfer-Encoding: 7bit From: Jonathan Vanasco Subject: Re: apache::session not writing to db Date: Mon, 19 Dec 2005 10:41:07 -0500 To: Michael Greenish X-Mailer: Apple Mail (2.746.2) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N first- add a timestamp column to your db store. you're going to need to clean out old sessions somehow. mysql> describe sessions; +-----------+-------------+------+-----+-------------------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+-------------+------+-----+-------------------+-------+ | id | varchar(32) | | PRI | | | | time | timestamp | YES | | CURRENT_TIMESTAMP | | | a_session | text | YES | | NULL | | +-----------+-------------+------+-----+-------------------+-------+ second - this is off of my code. maybe this will help. SiteUserClass: my $ApacheSessionOptions = { 'MySQL' => { DataSource => 'dbi:mysql:rs_session', UserName => 'rs_session_user', Password => 'rs_session_pass', LockDataSource => 'dbi:mysql:rs_session', LockUserName => 'rs_session_user', LockPassword => 'rs_session_pass', } }; constructor: $this->{'ApacheSessionOptions'} = $ApacheSessionOptions-> {$ApacheSessionStore}; MyFramework Site User Base Class if ( ${$this->{'ApacheSessionStore'}} eq 'MySQL' ) { DEBUG >0 && print STDERR "\nTying? Apache::Session::MySQL - $sessionID\n"; eval{ tie %{$this->{'__SESSION'}} , 'Apache::Session::MySQL', $sessionID, $this->{'ApacheSessionOptions'} } ; if ($@) { $error = 1; $sessionID = undef; } } Thirdly- you can either turn debugging on with the DBI. set tracelevel to 1 or 2. i don't know how to do that through apache::sesssion, you might be able to subclass the connect string. or set a general default for the DBI. i've just done it per handle on instantiation before. if you can do that, it helps a ton. another option is to restart mysql and have it log all queries, then tail that log in a terminal window. i often do that on my dev box, and just run a cronjob to truncate the file every night. also helps a ton.