Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70128 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54974 invoked from network); 14 Nov 2013 20:57:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Nov 2013 20:57:46 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.49 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.49 mail-la0-f49.google.com Received: from [209.85.215.49] ([209.85.215.49:59902] helo=mail-la0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D6/50-53459-84935825 for ; Thu, 14 Nov 2013 15:57:46 -0500 Received: by mail-la0-f49.google.com with SMTP id er20so2062846lab.36 for ; Thu, 14 Nov 2013 12:57:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=r6i1Psw5L7BeSoc1AT1NVhetLw0axq2s+IoM+uAuEoM=; b=cmR9TSOaCWEQv5a9Y6H0mtB1NnpuQ2Wjej3OfYMYAkmbnugA3PvDlzA4hZ/g0ASVYY XBQD41TW5i9AuwsP5LlobK3J2qEC83CjfPcdhiGtKuPT1XWtl+YOSQnJufH3g2+BlGc4 FU7a9dIsPhFlPQ56urwdikwcb5i2YArY3gAMHdqeFIVwf36I5zIYZ3YYD/Y3/cPY4NBo 77l2Cbhpmatf7kU2OMk3hFFhjK89mGjVPzQ/WIdefQ45+oVe0Crj8BEBLhkA2cYkhbZC h/pgQ3w+H0ZXfIOGMrsZAZr5hZpISd4VS5RhuRp+eKBOwX2yimCJoXYwky0RAfCu4jEV RSOA== X-Received: by 10.152.21.229 with SMTP id y5mr118303lae.87.1384462662228; Thu, 14 Nov 2013 12:57:42 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.154.201 with HTTP; Thu, 14 Nov 2013 12:57:02 -0800 (PST) In-Reply-To: References: Date: Fri, 15 Nov 2013 05:57:02 +0900 X-Google-Sender-Auth: BSdiJnjzPhLipoHyyg8DDvjGaV0 Message-ID: To: Adam Harvey Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e0158b3742fe4e204eb295515 Subject: Re: [PHP-DEV] Session cache, lock and write From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e0158b3742fe4e204eb295515 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Adam, On Fri, Nov 15, 2013 at 5:29 AM, Yasuo Ohgaki wrote: > How do you propose to check if session data was changed? For scalar >> types it's pretty easy, but it's possible for objects to alter their >> properties (including the ones they're persisting) on __wakeup() =E2=80= =94 I >> presume it would effectively be a comparison of what's about to be >> written versus what was read initially when it comes time to write the >> session? >> > > Session data is serialized. If content has changed, the data is changed. > Session could be large so I'm thinking using md5 hash to save memory. > Is there any better way? > I changed my mind. Since session data may be cached, it's better to save as it is and compare byte by byte. Having too large session data is not a good practice anyway. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --089e0158b3742fe4e204eb295515--