Re: [RFC] session_start(), read_only, lazy_write; Take 2

From: Date: Wed, 26 Mar 2014 11:15:44 +0000
Subject: Re: [RFC] session_start(), read_only, lazy_write; Take 2
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi,

On Wed, Mar 26, 2014 at 12:29 PM, Julien Pauli <[email protected]> wrote:
> For non BC changes etc.. , please, consider that you'll have a big time for
> rethinking the whole session module for PHP6 if you want to (and I think
> I'll be part of deep discussions here)
> So don't bother too much in searching solutions for introducting new
> concepts in PHP5.X session module while keeping BC. Keep all those for PHP6.

Of course, I've got more ideas for PHP6, but what I'm targeting here
are already voted features that could've been designed in a better
way.

Btw, another argument in merging updateTimestamp() into write() is
that userland implementations of it up until now have only been
possible by altering write(), so at least some users should be more
familiar with that approach. For example:

class MySessionHandler extends SessionHandler {

    public $fingerprint;

    public function read($session_id)
    {
        $session_data = parent::read($session_id);
        $this->fingerprint = md5($session_data);
        return $session_data;
    }

    public function write($session_id, $session_data)
    {
        if ($this->fingerprint === md5($session_data)
        {
            return touch(ini_get('session.save_path').'/sess_'.$session_id);
        }

        return parent::write($session_id, $session_data);
    }

Cheers,
Andrey.


Thread (29 messages)

« previous php.internals (#73444) next »