简体   繁体   中英

Asp.net share session between ASP.NET applications

I have 2 asp.net applications , I want to share session between the two applications. on my localhost i added 2 entries in the host file for the 2 subdomains say (test1.test.com) and (test2.test.com). In each of the applications I changed the web.config with

<httpCookies domain=".test.com">

also I changed the machine key as following

<machineKey validationKey="3FC58E938A92B609AB264D18C4A494CEB2A01100C7FE71AC6B41DD5372458D8265C5D06E72CC67F1F0AD58B8713DFDB0A8058861D39F47B5AA65310C8C45107D" decryptionKey="C24521F47AEAB67CC40F679632975C91AC0FCBD9A2E173B3" validation="SHA1" />

but I did not get the expected result (session is not shared between the 2 applications)

did I missed something, Help me where I am going wrong?

You have to setup a ASP.NET Session State Server . Here is a good blog post about this task. Also, you can use SQL Server to keep sessions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM