Problem
In the stack that we reuse between projects, we put a little too much data into a session to transfer data between pages. It was good in theory because it prevents fake, repeated attacks, etc., but it creates as many problems as it solves.
Session loss is a problem in itself, although it is mainly handled by the Session State Server application (or using SQL Server). More importantly, it is difficult to make the reverse button work correctly, as well as to do additional work to create a situation where the user can, say, open the same screen on three tabs to work with different records.
And this is just the tip of the iceberg.
Most of these problems have workarounds, but as I brush it off, all this friction gives me the feeling that passing data between pages using a session is the wrong direction.
What I really want to do here is the best practice that my store can use all the time to transfer data between pages, and then for new applications replace the key parts of our stack that currently rely on Session.
It would be nice if the final decision did not lead to the mountains of plumbing code.
Suggested Solutions
Session
As mentioned above, a heavy attack on a session seems like a good idea, but it interrupts the back button and causes some other problems.
There may be ways to get around all the problems, but this seems like a lot of extra work.
One thing that is very enjoyable in using a session is that faking is simply not a problem. Compared to passing everything through an unencrypted QueryString, you end up writing much less security code.
Submitting Cross Pages
In truth, I hardly considered this option. I'm having a problem with how strongly it is related to pages - if I start doing Prep.FindControl ("SomeTextBox"), it seems like a maintenance problem, if I ever want to go to this page from another page, which maybe does not have a SomeTextBox control.
It seems limited in other ways. Perhaps I want to get to the page via a link, for example.
Querystring
Currently, I am inclined to this strategy, as in the old days. But I probably want my QueryString to be encrypted to make it harder to intervene, and I would also like to deal with the problem of re-attacks.
For 4 guys from Rolla, there is an article about it .
However, it should be possible to create an HttpModule that takes care of all this and removes all sausage encryption from the page. Of course, Mads Christensen has an article in which he released one. However, the comments sound like he has problems with extremely common scenarios.
Other options
Of course, this is not an exaustive look at the options, but rather the main options that I am considering. This link contains a more complete list. Those that I did not mention, such as Cookies and Cache, are not suitable for transferring data between pages.
In closing ...
So how do you deal with the problem of transferring data between pages? What hidden seekers did you have to work with, and are there any pre-existing tools around this that solve them all flawlessly? Do you think you have a solution that you are completely satisfied with?
Thanks in advance!
Update: Just in case I am not clear enough, "transferring data between pages" that I am talking about, for example, passing the CustomerID key from the CustomerSearch.aspx page to Client.aspx, where the Client will be open and can be changed.