Later, in a different form handler, one can retrieve the previously stored values as follows:unless (open (Q_NEW_USER, ">/home/web/new_user.dat")) { print "Unable to open file for data storage."; } else { $q->save(\*Q_NEW_USER); }
The above code works great as long as only one user is accessing the form at a time. But if two users access the form concurrently then the second user can see the first user's data.unless (open (Q_NEW_USER, "/home/web/new_user.dat")){ my $message = "unable to open data file."; $q_new_user = new CGI; } else { $q_new_user = new CGI (\*Q_NEW_USER); }
Clearly, the problem is that every query object is stored using the same filename.
What would be the best way to provide for access by multiple concurrent users? I might mention that the site uses an Apache .htpasswd file to restrict access so that every user has his own unique login to the Apache 1.3 webserver.
In reply to Managing Concurrent CGI.pm Query Objects by sierrathedog04
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |