In practice? No problem, if what you want is for an anonymous user or not to fill in a field in which after navigating any other page and returning to it, the field will always be filled in that session, the answer really is that.
Now a long answer:
The big restriction that people usually (or at least in my experience) do in relation to saving data in SESSION
is in relation to the size of the information you are storing, ie if this information is not so great no problem none at all. Now what would be great information? Well, in the case of the Session depends a lot on the capacity of your Server, my recommendation, nothing that exceeds the 100kb of storage, take as an example the Cookies that has a limit of 20 kb but that on the other hand are sent and received with each request, soon SESSION
may be slightly larger.
The big question on when to choose the type of form of storage to adopt is to ask yourself questions like:
- Is the information to store large?
- Is the information temporary or should it be saved for a long time?
- Is the information confidential?
With these questions I believe we can come to conclusions, for example:
- If it is not so large (100kb), temporary and confidential, I can save in session
- If it is small (2kb, 5kb), temporary and non-confidential, I can save in cookies
- If it is large I should save it to a bank or file (it would already be necessary to identify the user in some way).
Be clear that I am not imposing rules, keep in mind that rules are very important but nothing is better than common sense, every situation has its best alternative even if it breaks standards, as great writers have already said: rules have been made to be broken.