Featured post
c# - saving and retrieving values from session state in asp.net -
i reviewing web code , not sure how asp.net session state works. helps gratefully appreciated.
if user object saved session state during login, , user.firstname , user.lastname set. if other web pages retrieve user object session , set firstname else persisted on other web pages? or, need re-add user object session once has been modified? thanks
session persisted on server, tracked via client. repeat - via client.
in cases, sessions tracked cookies. using example, when user object saved session:
session["userinfo"] = new user { firstname = "joe", lastname = "bloggs" };
a cookie sent client unique identifier. cookie passed along further http requests client/browser unless expires.
if user comes along (from different machine) first time, session["userinfo"]
null.
an alternative cookies "cookieless-session" - instead of using cookie store session identifer - identifier tacked onto url.
so answer no - other web pages (e.g other clients/machines/browsers) not have access information.
if want information shared between different clients web server, use cache.
however given context of question (user information), valid store information in session, relevant particular user (shouldn't shared).
an alternative lot of people use instead of sticking user info in session, put in generic principle get's attached forms authentication ticket.
up road choose.
- Get link
- X
- Other Apps
Comments
Post a Comment