My .Net Core application needs to use session variables set in another application (a WebForms app). Here is how it is configured in that WebForms application:
<sessionState mode="SQLServer" sqlConnectionString="data source=.;UID=SessionStateUser;Password=somepassword;Connect Timeout=15;" timeout="20" />
What can I do to access session variables from my .Net Core application?
This is not exactly your situation, but I was able to get a separate web application to access session data (stored in SQL Server) from my ASP.NET Core web app.
In ASP.NET Core, when backed by SQL Server, the session is stored in a table with Column ID and Column Value. ID is the session ID and the Value is the session data.
The session id is stored as an encrypted value in a cookie called .AspNetCore.Session. In my separate web app, I retrieved the value of this cookie, unprotected/unencrypted it, then leveraged some of the open-source asp.net core code (especially IDistributedCache) to load the session data using the unencrypted key.
It was all pretty complicated, and I'm pretty scared about having to upgrade some of the code I extracted (although it wasn't too much code).
So, it's a similar situation and it was doable. But only did it as a last resort and I would try to find a different solution if possible
Maybe this gives you some ideas though...