Can you share session variables between two .net 2.0+ applications?

I was told that this works, but ...

I assume that I just do not get this, it seems there is a hidden step that I can skip, can someone fix this or point out my mistake? Thanks.

I have an empty solution:
- inside - two .net 2.0 web applications
1) webapp1
2) webapp2

I want them to share the same session data.

My page settings:

Attachment 1:

Session("value") = "this is the value"

Appendix 2:

If Not (Session("value") Is Nothing) Then
    value = Session("value").ToString()
End If

My thought process:

1) go to services, enable the asp.net public service
2) open the web config in both projects: install

< machineKey 
validationKey="BFE2909A81903BB303D738555FEBC0C63EB39636F6FEFBF8005936CBF5FEB88CE327BDBD56AD70749F502FF9D5DECF575C13FA2D17CA8870ED21AD935635D4CC" 
decryptionKey="2A86BF77049EBA3A2FA786325592D640D5ACD17AF8FFAC04" validation="SHA1" />
< sessionState mode="StateServer" stateConnectionString="tcpip=localhost:42424" 
cookieless="false" timeout="20"/>

.
3)
4) , . -.

+3
4

? ASP.NET .

ASP Server State Server , 2 , 2 . , , , .

MSDN:

ASP.NET , ASP.NET -. HTTP - . , - HTTP- . , . ASP.NET .

ASP.NET ASP.NET-. ASP.NET, , .

, . , , ASP.NET. , , IIS.

, , API, . - .

+2

ASP.NET - . , web.config, , , , , . ApplicationName , . , , . , .

+5

, , inproc. stateerver sqlstate , - .

, ( "" iis), sibfolders, , .

+1

In addition, both applications must run in the same domain so that the user's browser uses the same cookie to store the session ID.

+1
source

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


All Articles