asp.net - How actually Session works in MVC? -
i'm little-bit confused session management in mvc4.
lets say, entered username , password , clicked on login button. on server side, got sessionid httpcontext.current.session. , validating user credentials against database. if user valid, adding sessionid, username , uiserid in session.
lets say, next time request came same machine , same browser, got same sessionid , allowing user access other information.
now have following questions:
- how server come know request came same browser , same machine?
- i found that, sessionid different different browser same same browser on different machine, if logged in machine1 , google chrome, possible use same session different browser?(means session available different machine same browser. possible?)
- how server understand request same user, logged in?
- in asp.net session maintained viewstate, view state not used in mvc, used in mvc?
first suggest read this wikipedia article http sessions. answers on question:
- with every request client sends
sessionid
in either cookie or query string. - this should not possible default. can done session hijacking.
- the server reads
sessionid
sent client in question 1. server maintains example key value data object can load right data givensessionid
. - asp mvc doesn't use viewstate since it's different approach asp.net. see this question more information.
Comments
Post a Comment