Reputation: 17193
I am getting the Object reference not set to an instance of an object.
error frequently even if I have tried increasing Session Timeout = 1440
in the web.config
file.
This happens on the Session["company_id"]
because I am using this session again and again in most of the pages.
I know that the Session["company_id"] is getting expired but Is there a way to increase the time of expiration..?
Upvotes: 0
Views: 3927
Reputation: 11844
The Object reference not set to an instance of an object
exception will comes only when a null or empty object is tried to use. Inorder to make the session not to be expired for a long time, you should follow two steps.
The Base Page for Detecting Sessions will explain you every thing you need to do, please refer it once.
Upvotes: 2