Rasmus Lerdorf wrote:
> Well, I wouldn't call that easy.  To do it in the session handler you
> would need to add a bunch of code to the write handler.  It would need to
> read the current session data, then compare that to the session data it
> was called with, and if different write the new session data.  You aren't
> saving much by doing it at that level.  

Unserizlied string is returnd from session_read function.
We can get MD5 sum of it and save the MD5 sum value.
(1 additional line)

When session_write function is called serialized session
value is passed. We can get MD5 sum of it and compare.
If sum differs, save the session data else just leave it.
(2 to 3 addtional lines)

I'm not sure, but I guess it could be faster than actually
saving it always, especially, when multiple web servers share
database, etc.

I think James is willing to give it a try :)

--
Yasuo Ohgaki

> The idea is to support read-only
> session requests where the write handler is not called at all when in
> read-only mode.
> 
> -Rasmus
> 
> On Sun, 18 Aug 2002, Yasuo Ohgaki wrote:
> 
> 
>>James E. Flemer wrote:
>>
>>>Would it be difficult to just add a "dirty" flag somewhere,
>>
>>It's easy.
>>Write your own session save handler does this if needed.
>>
>>--
>>Yasuo Ohgaki
>>
>>
>>--
>>PHP Development Mailing List <http://www.php.net/>
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
> 
> 
> 
> 




-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to