How to preserve session all time until user is logged out
Just get value from cookie and reset it all time from cookie if session is nul,
Create a BaseController and override OnActionExecuting, when any action is called.
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
if (SessionItems.Get(SessionKey.ACCOUNT) == null)
{
var ac = CookieHandler.GetCookies();
if (ac != null && ac.AccountId > 0)
{
var a = UnitOfWork.Accounts.AccountByEmail(ac.EmailAddress);
SessionItems.Add(SessionKey.ACCOUNT, a);
}
}
}
Share This with your friend by choosing any social account
Jack Carter
2 hours agoi think that some how, we learn who we really are and then live with that decision, great post!
you can view the more detail via link https://www.youtube.com/watch?v=HpZgwHU1GcIChing xang
2 hours agoi think that some how, we learn who we really are and then live with that decision, great post!
Danial Comb
2 hours agoi think that some how, we learn who we really are and then live with that decision, great post!
Jack Carter
2 hours agoi think that some how, we learn who we really are and then live with that decision, great post!