Skip to main content

Posts

Showing posts from December, 2016

Never ending (infinite) asp(.)net C# session

Session timeout is the worst nightmare of a developer especially if you do not have much experience in coding but senior enough to design an small application which becomes a mammoth in few months. So to all the mid-level experience guy, here is the key to success, do not make session variables in code behind, instead, create separate c# file either in app_code or in a separate project which you can call Utils as it will act like your utility file and create a public property in it which will call your DB whenever your session is null like following. So let's create a never ending session for the c#, Here is the scenario, suppose you have a user data-table coming from database which is on another project/DB and you have to get it through AD authentication or let's imagine it's a heavy DB call so calling, again and again, will reduce the app performance and that's why we use session which is again a non-performing thing but still better than DB chat. Here is your...