Removing content from database, security precautions Removing content from database, security precautions codeigniter codeigniter

Removing content from database, security precautions


What you need to protect against are CSRF attacks. Put simply, they are attacks which trick administrators into visiting a certain URL by GET or POST request.

The typical way to do that are tokens. When generating the link or form that points to the delete action, you generate a token that you send to the client (either as hidden form field or as part of the GET URL), also store it on the server for the current session and when that action is executed, you compare the submitted and the stored token and only continue if they match.

Many frameworks/systems have this built-in in some ways, for example are all forms generated with the Form API in Drupal protected against such attacks.