"Rob Bloodgood" <[EMAIL PROTECTED]> wrote:
>> A really simple trick would be rather than to use a cookie, if
>> you are saving state to DB anyway.  Set a flag in the DB and test
>> for its existence.
>>
>> sub handler{
>>     ....
>>     my $s = session->new();
>>     $s->continue();
>>
>>     my $flag = $s->get('flag');

Be careful of race conditions.  If things are timed right, two requests could 
run in parallel with just enough time differential to get around this test.  
You may want to see if there is a way to lock on something so this code 
section is serialized for any particular user.  If you're using a web farm, 
good luck.  Otherwise, either shared memory or a file link should be 
sufficient (non-NFS).

>>     if($flag){
>>         # do something else
>>     }
>>     else{
>>         # run insert for new signup
>>     }
>>     ....
>> }
-- 
James Smith <[EMAIL PROTECTED]>, 979-862-3725
Texas A&M CIS Operating Systems Group, Unix


Reply via email to