[ZDP] Printable version of Tom's version of ZBook

Martijn Pieters mj@antraciet.nl
Wed, 19 May 1999 15:02:56 +0200


At 12:38 19/05/99 , Tom Deprez wrote:
>Hi Martijn,
>
>Now I'm hoping not to be shot :-)
>
>Is it possible, to only show the dates which are modified after the last
>visit of a person? I think this can be done with cookies, but I don't know
>anything about it...

'T is done...

I did this by setting a cookie every time someone visits a page with the 
Tree on it, called ZDP_Last_Visit, containing the current date and time. 
This cookie will expire a year after having been set.

If this cookie is found on a returning visit, I set a session cookie (a 
cookie that expires when the browser is closed), with the date and time 
found in the ZDP_Last_Visit cookie. This cookie I named ZDP_Session. We 
don't set this cookie when it is already present.

This construction makes sure I really get the date of the last visit, not 
the date of the last pageview (which could be part of the current visit).

Then we compare the date and time found in the ZDP_Session cookie with the 
last-modified timestamp on the documents, and notify the visitor of the 
fact that certain documents have changed.

See the source of zb_menu.

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-6254545 Fax: +31-35-6254555
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------