I'm sure this question has been asked before, but I cannot find it with neither Google nor the suggested threads given to me while typing this question up. So without further Ado:
I am creating an application in which I would like to keep a user logged into my system. From what I understand, session state variables are pretty secure. So would it be safe to keep a user logged into the system (I'm thinking 1 day maximum), by checking their password against the database, if it matches, create a session variable like so:
Session["Expires"] = DateTime.Now.AddDays(1);
and using that that session variable to keep the user signed in by checking if DateTime.Now is less than Session["Expires"]? So if no session variable exists (never logged in), or the user has changed the session ID in their cookies it would just see them as not logged in and they would not have access anymore.