java - Is it generally considered OK to store a query string in a database? -


If I was taking a query string from the HTTP request requesting a web application, then it was stored directly in the MySQL database , Then use it later to make the original request url again, will it be considered okay?

I'm thinking that there are "characters" on special characters or multi-byte characters on the query string, for which I may need to encode some data before storing or archiving data.

> Thank you in advance.

Edit : The case of my special use will be like the following: Although my main concern is that a particular character on the query string can be the cause of unexpected problems.

  • The user submits a form.
  • During processing, we determine that the user needs to confirm his email.
  • We send an email to the user for confirmation and stored the original query string in the database Because we always want to meet any query string parameters that are on request.
  • After verifying the user's email, we send them back to the original form URL, and attach the original query string to ensure the query string parameters.

    I do not think anything wrong with it naturally, but I have a query format Instead of data, it is more understandable to store the purged values. In future, this future-proof may be slightly higher, for example if you later changed the name of the query string parameters in your app.

    Extension: Instead of storing A, B and C in three areas, to store it in a field called "Supreme 1 = A and Ultimate 2 =" CurieString " Which would be better called "Param 1, Para 2, and Param 3.

    Update:
    Depending on the usage you add to your question, especially about the need to store only part of this data temporarily As long as the user has not confirmed their account, if I intend to store this information for a long time then my original recommendation is standing.

Comments