Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

MVC Web Application is unable to find Session object on Dashboard page after being redirected from Login page of Web App where the session object is created when runs inside Dynamics CRM's iframe when CRM runs on Chrome. Works fine with IE and Firefox.

Posted on by 145

Hi All,

I have an MVC Web Application (.Net Framework 4.7.2) hosted on MS Azure. I have a Dynamics 365 CRM instance (online) which has an iFrame. My Web Application runs inside iframe and based upon logged-in CRM's User, it creates session object and redirects the User to Dashboard of the Web Application (when the iframe is loaded) where a check is there which checks whether the Session object is null or not. After being redirected from Login page to Dashboard, the session object is found null.

Previously it was working fine but from last 15/20 days, the session is found null on Dashboard page when CRM runs in Chrome (both normal and incognito). It is still working fine with IE and Firefox but my Client uses Chrome always and is facing this issue. I also tried the same multiple times but nothing worked.  I cleared all the history/cookies but the problem is still there.

I added below line in my application's Web.config file but the issue is still there.
"<sessionState cookieSameSite="None" cookieless="false" timeout="360">"

Login page Code (After authenticating logged-in CRM User):
Session["empDm"] = empDm;
return RedirectToAction("ViewDashboard", "CRMDashboard");

Dashboard page Code (ViewDashboard Action):
if (Session["empDm"] != null)
{
     //---- My Code ----
}
else
return View("SessionExpired");

The above code always goes to "else" as Session["empDm"] is found null.

All suggestions are appreciated and most welcome.

Thanks in Advance..

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans