asp.net mvc - unable to change property value in httpcontext.current.user -



asp.net mvc - unable to change property value in httpcontext.current.user -

unable alter property value in httpcontext.current.user. when user logged in getting user details , stored in httpcontext.current.user. below code.

formsauthenticationticket authticket = formsauthentication.decrypt(authcookie.value); var s = new system.web.script.serialization.javascriptserializer(); user obj = s.deserialize<user>(authticket.userdata); userinformation currentuser = new userinformation(obj.userid); currentuser.userid = obj.userid; currentuser.firstname = obj.userfname; currentuser.lastname = obj.userlname; currentuser.roles = obj.securitygroupname; currentuser.defaultwhse = 14; httpcontext.current.user = currentuser;

i used in global.asax.

but user can alter currentuser.defaultwhse value @ time when changed value beloww.

example: id=4

public actionresult changewhse(string id) { user.defaultwhse = convert.toint32(id); homecoming redirecttoaction("userwhsemenu"); }

the user.defaultwhse 4 within method. when leaves assigning value 14 again. please guide me.

asp.net-mvc asp.net-mvc-4 c#-4.0

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -