Last post May 25, 2020 04:12 PM by bruce (sqlwork.com)
May 19, 2020 01:31 PMemail@example.com|LINK
we have an issue with the Session Middleware in asp.net core . actually if i am trying to access application from one host it's working fine. then with same host if i am trying to access the another application. the [previously opened ] / first application's
session getting cleared .
what will be issue with session/ session middleware . please advise.
using below in application processing pipeline
and the service is configured using -
May 19, 2020 03:16 PM|bruce (sqlwork.com)|LINK
what are the urls of the two applications?
May 20, 2020 10:09 AMfirstname.lastname@example.org|LINK
The URLs let say
1st -- https://example.com/Application1?sessionkey=12344
2nd -- https://example.com/Application2?sessionkey=12564
after accessing the first one and then after if i access 2nd application the session of 1st application is getting cleared automatically.
May 20, 2020 02:32 PM|bruce (sqlwork.com)|LINK
And what is your session configuration?
May 21, 2020 04:47 AMemail@example.com|LINK
options.CheckConsentNeeded = context => false;
options.MinimumSameSitePolicy = SameSiteMode.None;
options.Configuration = AppSettings.Properties["abcd"].ToString();
options.InstanceName = "aserd";
options.Cookie.Name = "xyz";
options.IdleTimeout = TimeSpan.FromMinutes(90);
options.Cookie.HttpOnly = false;
options.Cookie.IsEssential = true;
application processing pipeline :-
May 21, 2020 04:40 PM|bruce (sqlwork.com)|LINK
use the browser debugger to check the domain of the session cookie. they probably match. so app2 replaces app1 session cookie with its session id.
May 25, 2020 07:48 AMfirstname.lastname@example.org|LINK
yes, the domains are same for both the cookies. so, you mean the domain for both the cookies can't be same.
May 25, 2020 04:12 PM|bruce (sqlwork.com)|LINK
That’s correct. As each site has its own session Id they cannot use the same cookie. Change the domain or cookie names.