R
R
Razunter2021-11-17 15:45:41
JavaScript
Razunter, 2021-11-17 15:45:41

How bad is the idea of ​​storing all query parameters for a page in a cookie?

The backend programmer is very fond extract($_POST);of code and insists that without exception, all GET requests to the page

/index.html?a=1&b=2&c=3
must be stored in a cookie and then passed to the back. Are there any arguments against this?

I clarify: I'm interested in saving everything in a row. In cookies or not - it will be seen there ...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
DevMan, 2021-11-17
@Razunter

because he is a deer.
sessions have long been invented for sharing.

V
Vladimir Korotenko, 2021-11-17
@firedragon

the request
/index.html?a=1&b=2&c=3
is self-sufficient, this is code duplication and this is definitely bad.
And yes, in the post it is bad practice to pass parameters, let them go in the request body, although this is not a strict definition.
In post it is normal to send requests in REST notation
For example
/user/orders
and add filtering parameters in the request body.

D
Dmitry Belyaev, 2021-11-17
@bingo347

Let the backender read what cookies are and what they are for, for example here: https://developer.mozilla.org/ru/docs/Web/HTTP/Cookies
Explain that hammering nails with a microscope is not a good idea, even if he is so used to it.
If it is not possible to act directly, then it is possible through a tech lead or team lead.

Are there any arguments against this?
at least the fact that cookies are long-term storage, and not a means of communication between the client and the server
Backend programmer lovesextract($_POST);
as far as I remember php, get parameters are passed to $_GETand do not affect in any way$_POST

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question