I tried doing this without setting the save handler. The same problem exists
on the MAC with broswers: Firefox, Camino and Safari.

So this "problem" may reside in Zend_Session. I will examine Zend_Session
and check for existing bugs. Thanks, Jordan for the ideas to test.

FYI using MAMP for installation on this MAC.
PHP 5.2.1
MySQL 5.0.37 - InnoDb

CREATE TABLE `Sessions` (
  `id` varchar(32) NOT NULL,
  `modified` int(11) default NULL,
  `lifetime` int(11) default NULL,
  `data` text,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1


On 10/2/07, Jordan Raub <[EMAIL PROTECTED]> wrote:
>
> What did similar tests show when using the default save handler? What is
> the create table statement you used for your table and the corresponding
> configuration array sent to
> the Zend_Session_SaveHandler_DbTable constructor? Might this be a browser
> issue? The browser may drop the cookie for some strange reason. Are you
> using firefox? safari? I'm using a mac with firefox for my testing, but I
> also use safari for testing too. I'm also using ubuntu for my internal
> server testing. Anyone have similar troubles with IE? What version of PHP
> are you using and which type of RDBMS and version?
>
> I'm in the process of moving so I might not be able to get to this for a
> week-ish. (not even on my dev box right now)
>
> Side note: I did find a lot of unit tests I wrote but forgot to put them
> into the repository, when I get settled I'll post them.
>
> Thanks,
> Jordan
>
> He that teaches himself hath a fool for his master. -- Benjamin Franklin
> Poor is the pupil who does not surpass his master. -- Leonardo da Vinci.
>
> ----- Original Message ----
> From: Jeremy Postlethwaite <[EMAIL PROTECTED]>
> To: Holografix <[EMAIL PROTECTED]>
> Cc: Jordan Raub <[EMAIL PROTECTED]>; ZendFramework General <
> [email protected]>
> Sent: Monday, October 1, 2007 12:21:23 AM
> Subject: Re: [fw-general] using Zend_Auth with a custom Session Save
> Handler ?
>
> Does any else have an issue with this session handler regenerating IDs and
> inserting them into new rows in the db as opposed to updating the respective
> row?
>
> This happens when I hold down <cmd>+r (<ctrl>+r for you windows users) for
> a rapid refresh.
>
> This is a simple test I run for performance and stress testing. I try to
> see how many page loads in a given period. Easier than putting in bench
> specific code.
>
> When I do the rapid refresh test the session handler does not give any
> errors, but creates a new session. This does not happen if I press <cmd>+r
> slowly. My page counter increments as it should.
>
> As a note when the session handler creates a new row, the last session is
> ignored and abandoned, no info is transferred from the `data` field. Here is
> a dump of  my date:
>
>
> mysql> select * from Sessions;
>
> +----------------------------------+------------+----------+---------------------------------------+
> | id                               | modified   | lifetime |
> data                                  |
>
> +----------------------------------+------------+----------+---------------------------------------+
> | 127e86a27b6f5104c7c03dad9e379576 | 1191218802 |  2592000 |
> stats|a:1:{s:12:"pages_loaded";i:1;}  |
> | 17695c011630fa1a1029b9814cb3cce3 | 1191218802 |  2592000 |
> stats|a:1:{s:12:"pages_loaded";i:1;}  |
> | 2cc3f6306f78b002c3297d3045a9c760 | 1191218802 |  2592000 |
> stats|a:1:{s:12:"pages_loaded";i:1;}  |
> | 37989584220d165d2ca615cd9912e9eb | 1191218801 |  2592000 |
> stats|a:1:{s:12:"pages_loaded";i:11;} |
> | 422d6a23c3308f2ab143c888388c94f0 | 1191218802 |  2592000 |
> stats|a:1:{s:12:"pages_loaded";i:1;}  |
> | 47f279f9aa66e98448cdc76bad42e310 | 1191218802 |  2592000 |
> stats|a:1:{s:12:"pages_loaded";i:1;}  |
> | 9e8e01ce6520eabe9b68179cc6b36dac | 1191218802 |  2592000 |
> stats|a:1:{s:12:"pages_loaded";i:1;}  |
> | b3ce9e5b0b230630d631a6e039e3ce3d | 1191218801 |  2592000 |
> stats|a:1:{s:12:"pages_loaded";i:1;}  |
> | ca0de03c5b09f17bfa371d5692efc840 | 1191218802 |  2592000 |
> stats|a:1:{s:12:"pages_loaded";i:1;}  |
> | cdf01158504180e9509f1a9f3e475dee | 1191218802 |  2592000 |
> stats|a:1:{s:12:"pages_loaded";i:1;}  |
> | d16a552ccc93671799e0c775e4775315 | 1191218809 |  2592000 |
> stats|a:1:{s:12:"pages_loaded";i:5;}  |
> | e9391c2e2b65ad436602966ea11460b4 | 1191218802 |  2592000 |
> stats|a:1:{s:12:"pages_loaded";i:1;}  |
>
> +----------------------------------+------------+----------+---------------------------------------+
> 12 rows in set (0.00 sec)
>
> As you can see the 4th and 2nd to last row have pages_loaded incremented.
> The others were created by quickly holding <cmd>+r.
>
> I have not had a lot of time to debug this. I thought I was keeping it
> simple.
>
> If other people could try the refresh test to see if this happens on your
> box, please let me know, It may make trouble shooting easier.
>
> I am running on a Macbook Pro. I will not be able to test this on my
> FreeBSD Unix server until next week.
>
> Thanks,
>
> Jeremy
>
>
> On 9/24/07, Holografix <[EMAIL PROTECTED]> wrote:
> > +1 here. Hope to see this component in ZF Core soon.
> > Great work Jordan. Thank you very much.
> >
> > Cheers
> > holo
> >
> >
> > Jordan Raub escreveu:
> > > Sweet! I thought this went to the wayside. I've been using it too on
> my
> > > stuff with no problems. Do you think this could make it into the trunk
>
> > > soon? Here is the link to the proposal too
> > > http://framework.zend.com/wiki/display/ZFPROP/Zend_Session_SaveHandler_DbTable
>
> > >
> > > Thanks,
> > > Jordan
> > >
> > > He that teaches himself hath a fool for his master. -- Benjamin
> Franklin
> > > Poor is the pupil who does not surpass his master. -- Leonardo da
> Vinci.
> > >
> > >
> > > ----- Original Message ----
> > > From: Simon Mundy <[EMAIL PROTECTED]>
> > > To: Truppe Steven < [EMAIL PROTECTED]>
> > > Cc: [email protected]
> > > Sent: Saturday, September 22, 2007 7:10:53 PM
> > > Subject: Re: [fw-general] using Zend_Auth with a custom Session Save
> > > Handler ?
> > >
> > > The Zend_Session_SaveHandler_DbTable component is tucked away in the
> > > incubator - I've had it running now for the last couple of weeks in
> > > combination with Zend_Auth and it's been working wonderfully. It's
> been
> > > used in conjunction with a series of linked microsites using different
> > > subdomains and this approach has been the most effective way for me to
> > > manage sessions smoothly across them all (especially if I decide to
> > > offload my database and sessions to a standalone server down the
> track).
> > >
> > > First you set up your session table. Here's my MySQL dump (nearly
> > > identical to the example shown on the proposal page
> > > for Zend_Session_SaveHandler_DbTable):-
> > >
> > > CREATE TABLE `session_list` (
> > >   `id` varchar(32) collate utf8_unicode_ci NOT NULL,
> > >   `save_path` varchar(32) collate utf8_unicode_ci NOT NULL,
> > >   `name` varchar(32) collate utf8_unicode_ci NOT NULL default '',
> > >   `modified` int(11) default NULL,
> > >   `lifetime` int(11) default NULL,
> > >   `data` text collate utf8_unicode_ci,
> > >   PRIMARY KEY  (`id`,`save_path`,`name`)
> > > ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
> PACK_KEYS=1;
> > >
> > > Here's an example of my config.ini file:-
> > >
> > > [all]
> > >
> > > ;
> > >
> -----------------------------------------------------------------------------
> > > ; Database connection
> > > ;
> > >
> -----------------------------------------------------------------------------
>
> > > db.connection = pdo_mysql
> > > db.host = localhost
> > > db.username = myusername
> > > db.password = mypassword
> > > db.dbname = mydatabase
> > >
> > > ;
> > >
> -----------------------------------------------------------------------------
>
> > > ; Session
> > > ;
> > >
> -----------------------------------------------------------------------------
> > > session.cookie_domain = mydomain.com.au
> > > session.name = mycustomsessionname
> > > session.remember_me_seconds = 864000
> > > session.use_only_cookies = on
> > >
> > > sessionhandler.name = session_list
> > > sessionhandler.lifetime = 864000
> > > sessionhandler.primary = id
> > > sessionhandler.dataColumn = data
> > > sessionhandler.modifiedColumn = modified
> > > sessionhandler.lifetimeColumn = lifetime
> > > sessionhandler.overrideLifetime = true
> > >
> > > This is how I set it up in my bootstrap:-
> > >
> > > // Set up database
> > > $db = Zend_Db::factory($config->db->connection,
> $config->db->toArray());
> > > Zend_Db_Table::setDefaultAdapter($db);
> > >
> > > // Set session defaults
> > > Zend_Session::setOptions($config->session->toArray());
> > > Zend_Session::setSaveHandler(new
> > > Zend_Session_SaveHandler_DbTable($config->sessionhandler->toArray()));
> > >
> > > And then continue to use Zend_Auth as you would normally.
> > >
> > > Note that the storage engine for Zend_Auth bears no relation to the
> > > session at all - this will be a completely separate table (if you're
> > > using database authentication).
> > >
> > > Hope this gets you on the way!
> > >
> > > Cheerio
> > >
> > >> Hi,
> > >>
> > >> i have a class that implements Zend_Session_SaveHandler_Interface to
> > >> save the session data inside a database. now i want this save handler
> to
> > >> be used to store the identity after authentication.
> > >>
> > >> in the manual i found this:
> > >>
> > >>    /By default, Zend_Auth provides persistent storage of the identity
> > >>    from a successful authentication attempt using the PHP session.
> Upon
> > >>    a successful authentication attempt, Zend_Auth::authenticate()
> > >>    stores the identity from the authentication result into persistent
> > >>    storage. Unless configured otherwise, Zend_Auth uses a storage
> class
> > >>    named Zend_Auth_Storage_Session, which, in turn, uses
> Zend_Session.
> > >>    A custom class may instead be used by providing an object that
> > >>    implements Zend_Auth_Storage_Interface to
> Zend_Auth::setStorage()./
> > >>
> > >> What does that mean for the Zend_Session_SaveHandler implementation ?
> Is
> > >> Zend_Auth_Storage_Interface the same interface ??
> > >>
> > >>
> > >> I only found Zend_Session::setSaveHandler() but i have no idea how to
> > >> use this in combination with Zend_Auth (because Zend_Auth handles
> > >> Zend_Session internal).
> > >>
> > >> I hope someone can help me with this.
> > >>
> > >> best regards,
> > >> Truppe Steven
> > >
> > > --
> > >
> > > Simon Mundy | Director | PEPTOLAB
> > >
> > > """ " "" """""" "" "" """"""" " "" """"" " """"" " """""" "" "
> > > 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
> > > Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654
> 4124
> > > http://www.peptolab.com
> > >
> > >
> >
> >
>
>

Reply via email to