I hope, all is stated enough clearly.
Realisation is elementary - it can be made easily in applications as PERL and PHP, or in the compiled modules.
To especially refined programmers I recommend to insert a feature like "not killed cookies".
There will be questions - write : firstname.lastname@example.org
With true respect,
Oleg Yu. Novikov