java - Getting cookie value or getting data from DB? -


which of these operations require more time , resources? getting cookie value or getting data db?

they both serve different purpose. cookies used store preferences , disposable in sense if aren't available (like client deleted them) preferences switch defaults.

database on other hand store data should persist through-out application's life. example, user login data. can't save cookies security reasons may lose them time.

cookies can save text whereas can practically save in database binary objects.

any preferences saved cookies take effect if user uses same browser cookies stored on. so, databases more suited preferences should mobile.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -