javascript - Asp.net web api Session -


i'm not getting concept web api , session.

i've created asp.net web api project , integrated angularjs in it.every time i'm gonna call web api.

i have read articles state not use session in web api. understand web api stateless approach. agree. stil there way use session.

first question: if, after login, want show user name on every page should web api approach????

second question: don't use session in webapi. other way/approach store client information safely.

if use html5 local storage, can editable. if cookie used, can deleted.

what , how should user till application in running mode?

this semantics clouds discussion. people confuse session object statelessness. , say: 'don't use session because isn't stateless!'.

however mean should strive have restful calls idempotent, meaning don't change behavior depending on whatever in background.

session, or runtime-cache, or whatever use cache data, has no effect on stateless design, because really, what's next? database statefull too? , shouldn't read data that? nonsense obviously; underlying storage, if it's in-memory or on disk has no reflection on state client.

although feel @majob makes other valid points not using session object, there no harm using kind of cache in web api, session or else. never let fact if in session return different result when out of session.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -