asp.net mvc - choose between asp identity claims and sessions data -


i trying make choice between storing user specific data in mvc application either identity claims or session data reduce number , frequency of database round trips on requests. however, considering performance, security , other best practice considerations, don't know route go.

i appreciate suggestions on this.

imo (and opinion) based on know claims, cookies , storage rules:

performance wise have never seen difference between claims , session storage (unless cookie gets large lot of claims) both seem same performance hit far speed goes (they both have go lookup data someplace (claims = cookie, session = server drive storage) best pratice fall along lines of how data need store.

from have seen in experience (correct me if i'm wrong) session data stored on disk on server , has servers hard drive free space size limits etc whereas cookies have hard coded data size limit , more claims store larger cookie gets, if maxing out cookie, client may see performance hit in fact sending entire cookie data in every request site, session server looks data locally , there less data sent browser.

so opinion of best practice if persisted data save database lookup small footprint there isn't best practice use whatever prefer, if storing lot of bits strings session best practice in opinion saves data round trip between client/server , doesn't have size limit may run @ point , pull hair out wondering why data isn't there (done in past myself because if cookie large client silently refuses , took 3 days figure out size of cookie )


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -