Posted on: 12/8/2013 5:32:25 AM | Views : 522

From what I've been reading, it seems like if my site user is logged in with a cookie, but leave a window open for an extended period of time, there's a chance their session will expire and cause problems during a SQL Insert. Is this correct? Here's the code I'm currently using during an insert
protected void Item_Inserting(object sender, DetailsViewInsertEventArgs e) { if (IsValid) { MembershipUser User = Membership.GetUser(); if (User != null) { //perform insert code in here } } } Now, do I need to change it to something like
if(User != null && Session != null)
so if I have a cookie set to keep a user logged in for several days exists and they keep a window with a form open and submit it after an extended period of time, it will make sure the session isn't null to prevent an error?

Go to the complete details ...