c# - Cookie expiry date not set -


here get:

protected string identifier {         {         httpcookie cookie = request.cookies[identifier_cookie];          if (cookie != null)         {             return cookie.value;         }         else         {             cookie = new httpcookie(identifier_cookie);             cookie.value = guid.newguid().tostring();             cookie.expires = datetime.now.addyears(1);             response.cookies.add(cookie);              return cookie.value;         }     } } 

when running project locally, cookie's expiry date set expected

local

but when run live, cookie's expiry date when browsing session ends.

live

what doing wrong?

before doing else, suggest clear cache , cookies.

protected string identifier {         {         httpcookie cookie = request.cookies[identifier_cookie];          if (!cookie)         {             cookie = new httpcookie(identifier_cookie);             cookie.value = guid.newguid().tostring();         }cookie.expires = datetime.now.addyears(1);         response.cookies.set(cookie);          return cookie.value     } } 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -