in reply to Sessions, Perl and MySQL
When I load the page, either adding or removing the admin "powers", it times out, then the dang site won't load for me for at least an hour. If I don't do that,If you don't do what?
...then it just adds them or removes them depending on the action, but it don't work until they Next login.I would find out exactly where this script is getting hung up (you say it times out, you mean it gets hung up somewhere?). And CWT::Site_DB is not a CPAN module (I assume maybe you got it from the book?), so its hard to tell what exactly is happening there. Is this vanilla MySQL with no transactions? Otherwise, I might say there's a deadlock, but I assume its not the new fangled MySQL with extra added transaction flavor. And if you clear the admin attribute, but it doesn't take effect until their next login, then are you checking for the attribute every time they request an admin page? Do the 'attr' and 'clear_attr' methods update the database immediately?
Update: Putting raw user input into SQL statements is in general a bad idea, use placeholders or at least the DBI quote() method. (Ah, tachyon mentions this below, but its worth reiterating).
|
---|