forms authentication - c# Update Cookie, without forcing the user to login -



forms authentication - c# Update Cookie, without forcing the user to login -

i have 'ui' setting controls appearance, user can alter setting, involves updating cookie.

i seem able update, forces user authenticate again, how can update cookie without getting user autenticate again?

//we need update usertoken menuoptionchanged var usertoken2 = new usertoken(schedule.minimisedmenubool); httpcookie cookie = formsauthentication.getauthcookie(usertoken.username, false); var ticket = formsauthentication.decrypt(cookie.value); var newticket = new formsauthenticationticket(ticket.version,ticket.name,ticket.issuedate,ticket.expiration,false,usertoken2.calculaterawtoken(),ticket.cookiepath); // encrypt ticket , store in cookie cookie.value = formsauthentication.encrypt(newticket); system.web.httpcontext.current.response.cookies.set(cookie);

why saving ui appearance preferences in authentication cookie?

is there wrong saving separate cookie?

httpcookie menucookie = new httpcookie("menucookie"); menucookie.values.add("menuappearance", schedule.minimisedmenubool); menucookie.expires = datetime.now.addyears(1); response.cookies.add(menucookie);

then can optionally parse cookie logged in users.

c# forms-authentication

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -