perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Greenish <grea...@yahoo.com>
Subject Re: apache::session not writing to db
Date Sun, 18 Dec 2005 21:11:06 GMT
Thanks Malcolm for the response.

Ok, so the constructor now is:

    my %session;
    tie %session, 'Apache::Session::MySQL', $sid, {
        Handle => $_dbh,
        LockHandle => $_dbh
    };

    $session{'stuff'} = 'is this in the database?';
    untie( %session );

But still no data in the a_session:
+----------------------------------+---------------------------------------------------------------------------------------------+
| id                               | a_session        
                                                      
                   |
+----------------------------------+---------------------------------------------------------------------------------------------+
| e478ac9a4b1a141cfeb9c784f5fdbe47 |                  
                                                      
                |
+----------------------------------+---------------------------------------------------------------------------------------------+
I truncated the table between attempts.

I checked the privileges:
+-----------+--------------+------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+
| Host      | Db           | User       | Select_priv
| Insert_priv | Update_priv | Delete_priv |
Create_priv | Drop_priv | Grant_priv | References_priv
| Index_priv | Alter_priv | Create_tmp_table_priv |
Lock_tables_priv |
+-----------+--------------+------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+
localhost | db_name | db_user | Y           | Y       
   | Y           | Y           | Y           | Y      
  | N          | Y               | Y          | Y     
    | Y                     | Y           |

The only one with 'N' is the Grant_priv, which one
would expect for a non-root account.  And nothing in
the apache error.log relating to the database.  I
couldn't track down the location of the MySQL binary
files to see if an actual update is being performed.

And I killed and restarted Apache2 just in case.

--- Malcolm J Harwood
<mjhlist-modperl@liminalflux.net> wrote:

> On Sunday 18 December 2005 02:31 pm, Michael
> Greenish wrote:
> 
> > Note that I set 'stuff' immediately after the
> session
> > is created.  I would expect at this point that the
> > database be updated.
> 
> That's incorrect. The database is only updated when
> the session is untied 
> (usually on going out of scope).
> 
> > The session is inserted into the sessions table,
> but
> > the a_session is never updated.  I tried using the
> > tied( %session )->make_modified, and I tried
> untie(
> > %session ) when I am done with the request, but
> none
> > of those seem to cause anything to be written in
> the
> > database.
> 
> untie %session should work. What happens if you do
> that in your constructor 
> after:
> 
> >	$session{'stuff'} = 'is this in the database?';
> 
> If that works, you've got a problem in your code
> somewhere. If it doesn't, the 
> it could be a db permissions issue or something. Do
> you get any errors in 
> your logs?
> 
> 
> -- 
> If you want to kiss the sky 
> Better learn how to kneel
> - 'Mysterious Ways' U2
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Mime
View raw message