I want sharing of session between my 2 web application.web config of my both application have same machineKey but it is not working for sharing of session.Is there any other options?
Asked
Active
Viewed 4,885 times
1 Answers
0
Check this, it is possible but not recommended. You need to use sessionState SQLServer to achieve this.
Sharing sessions across applications using the ASP.NET Session State Service
But i would suggest creating a table and store values in that and access it in old fashioned way. Ultimately sessionState SQLServer is also doing the same thing.
-
Is there any other option without using db. – user1939371 Apr 25 '13 at 07:30
-
@user1939371 you have to store values somewhere, either DB or file system as a XML or a flat text file. And if you try to write a file in ASP.NET, security restrictions and Impersonaitions complexities will come into play. – Guru Kara Apr 25 '13 at 07:55
-
Create a table and name it something like CrossAppSession("key", "value") store your cross app session in this and remove the entries using relevant logic. – Guru Kara Apr 25 '13 at 09:24
-
with the help of SQL Server session State how this is possible? – user1939371 Apr 25 '13 at 09:44
-
If you read the link provided it states some hacky way to achive it, BUT there is a comment of using it seeing that the session keys are not getting cleared and DB growing huge. – Guru Kara Apr 25 '13 at 09:48
-
its means this work is not good through Sql Server session state – user1939371 Apr 25 '13 at 10:04