I am facing one weird issue while accessing session value in my Umbraco 8 website. So we are having 2 website one is public facing Umbraco website and second is secured website to be accessible after login as a normal MVC application hosted as subdomain in IIS. When I try to access login information set inside session in normal application inside Umbraco application it always return null value. This issue occurs only when we read session data in my Umbraco application. When I return back to another application I am able to get session value. Wondering if I am missing something while retrieving the session value in my Umbraco application? Anyone have any idea, what could be the reason of this issue? Thanks in advance..
Controller code setting the Session value it pretty straight forward:
Issue while accessing session value
I am facing one weird issue while accessing session value in my Umbraco 8 website. So we are having 2 website one is public facing Umbraco website and second is secured website to be accessible after login as a normal MVC application hosted as subdomain in IIS. When I try to access login information set inside session in normal application inside Umbraco application it always return null value. This issue occurs only when we read session data in my Umbraco application. When I return back to another application I am able to get session value. Wondering if I am missing something while retrieving the session value in my Umbraco application? Anyone have any idea, what could be the reason of this issue? Thanks in advance..
Controller code setting the Session value it pretty straight forward:
Controller:
public class UserController : Controller
Method:
[HttpPost] public string SetSession(OnlineUser UserObj) { Session["UserInfo"] = UserObj; return null; }
Hi Mukesh
Can you provide code examples, please?
Thanks,
Alex
Hey Alex, thanks for quick response. It was a simple Session add and getting the value in View. Here is the simple code snippet used:
In second MVC site which I hosted in IIS within my main Umbraco site to work as a subdomain:
Session["UserInfo"] = UserObj;
In Umbraco layout page:
var userInfoSession = System.Web.HttpContext.Current.Session["UserInfo"];
Both are using the same Application pool. Wondering what cause the Session value not accessible between both sites..
What type of controller are you using? Can you show all controller code?
Hi @Alex, I have updated my question to include the details..
is working on a reply...