frank_2k4 has asked for the wisdom of the Perl Monks concerning the following question:

I am creating a form that will be sent via email only. I need to ensure that a particular form value is not duplicated within a given amount of time. I am using CGI::Session, and Cookies to store the parameter, however the parameter can change each time a form is submitted. Can someone point me in the right direction on how to store the values each time a form is submitted? For example, I want to store a hostname value from a form in a CGI::Session parameter. The form will be submitted many times with different hostnames. I need to make sure the hostnames are not duplicated, and I need an easy way to add, check against the previous submitted hostnames for a given 4 hour session.

Replies are listed 'Best First'.
Re: CGI::Session and parameters
by MidLifeXis (Monsignor) on Jun 03, 2004 at 03:20 UTC

    Wouldn't you just store the values in a hash (keyed by the hostname, values are the time), and store that in the session? Then, as the request comes in, you would load the existing hash from the session, validate the current request, and refuse or update based on the results?

    It has been a little while since I read through the C::S information, but check out CGI::Session::Tutorial, I would guess that there would be something that could be modified in there.

    --MidLifeXis