ASP.NET Transferring data between multiple page sessions

Thus, there seems to be no fairly broad answer to the question of how to transfer data between multiple pages. Having done a little homework here, why (or at least what I learned):

  • ViewState variables are not stored on different pages.
  • Session variables are volatile and should be used sparingly.
  • Cookies have a potential security issue and take time and should be small.
  • Storing vars in a URL limits the amount of data and can be unsafe.
  • Storing vars temporarily in db is a real light because you add one table to an object that could potentially be transferred to another page.

    For now, it looks like I will use hidden fields to pass the keyword and unique identifier to the next page, and then get the data from db. What do you think about that? What is the best way to do this? I am at the beginning of the development of this application, so making changes is now preferable.

edit: I expect many users to use this application at any given time, does this affect whether I should use a session based on SQL Server?
+3
source share
4 answers

Session variables should work well for your needs.

StateServer SQLServer. InProc , ( , , web.config ..). , . , cookieless ( ), , .

, , , . - , .

, . , .

+1

, , . Session , , Session. , , .

Session , - . , / db, .

:

  • , →
  • , →

, -, , , . . , . , , .

+5

, . ?

, , , . usercontrols , . .

, , - # 5 . "" , , .

, , , .

, , .

- " cookie " - cookie, , . , , , . ASP.NET, , . , , .

+3

. , .

Session variables work very well when used reasonably. In InProc sessions on traffic, heavy sites can quickly flush your resources, but you can always switch to a SQL Server-based session that does most of the database work for you.

0
source

Source: https://habr.com/ru/post/1794781/


All Articles