I find using a session object (.net) an evil practice, am I too harsh?

Asking for your opinion on the session object, I never use it (only forced to work) because of its problems when scaling the server. I understand that you can exit proc and manage sql server sessions, but I just don't like this idea.

I would rather create a better database design around the problem, rather than just throwing things in a session to save database calls.

Am I alone on this? Should I rethink my position in the sessions?

+3
source share
13 answers

. - , ( ..) , , . , , , , , .

+10

, :

  • /-/ . - . - ( , db, ), /. , - , . get-out - .

  • . , .

" ".

+10

, Session , , . , , , .

+5

___________ (), . , , ________ .

. . , , - .

+5

, . - .

, , , .

, , , .

+2

- ASP.NET, . , , SQL Server ; / , ! .

+1

, , , .

"" cookie, , .

... ... , , .

User? UserId?

+1

, , , , , . , Microsoft Velocity ( CTP). , - . , , , .

+1

, . , , , .

- . , , , . - . , -, SQL-.

- . , , .

+1

, ?

- , ( ), , ...

0

, - . , InProc , . , , .

, .

0

-. -, , - , , ... , , , , ( ), , -. , , , .

From the very beginning, you'd better start with a custom high-performance solution. The more I work with him, the better I understand that the Session is a bit complicated to be true, in terms of what it offers ... but there are legitimate uses.

0
source

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


All Articles