Signed_request lost in ASP.NET session, confusing my website
- by Csabi
I have an ASP.NET MVC 3 website which is available both from a specific public url, and I'm also making be available as a Facebook App.
Inside my website logic, in some places I have to determine whether the current request is from the Facebook-app, or from the public website, because I want to display content based on this environment.
So, for eg. if the user is using my site as a facebook-app, then I want to display a picture, and if the user is using my site normally, then I don't wanna display a picture.
To determine whether I'm from a Facebook app, I check the "signed_request" in the HttpContext.Request, and store it in the HttpSession to be available for my other actions, not just for that action (url) which is defined for my Facebook app.
So when a child-action is executed, I can determine based on the Session, that the website is used as a FB-app or not.
The problem happens, when the Session times out, because then althought the logic is still running inside Facebook, my logic thinks it's not inside Facebook.
Any advice?