I've been doing a lot of reading lately about best practices when it comes to Web App design. My language of expertise is PHP/MySQL. When creating an MVC architecture for an application I'm developing, I always come across the problem of where to store invalid form submissions (so that the user doesn't have to re-enter the data, and helpful error messages can be displayed).
Usually I've settled with storing it as a serialized object in a SESSION variable, but my latest reading has told me sessions are bad and take away from stateless web development. A few alternatives I've thought of are:
- storing it in the database as I would with valid input, but flagging it as invalid
- storing it in the database in a separate table specific for invalid form submissions
- storing it in a text file
They all have their downsides.
- Not ALL forms result in the creation of a (single) database entity.
- and 3. both seem like the same idea as SESSION variables
What would you recommend?