Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

Handle the case when an app tries to store so many data tha a cookie size isn't enough for it #4

Closed
jotabe-net opened this issue Feb 21, 2013 · 2 comments
Labels

Comments

@jotabe-net
Copy link

When an application tries to store quite a lot of objects in TempData the space required to store it can be greater than the available space in a cookie. In this case CookieTempData could have any of this three behaviors:

  • throw an Exception showing the problem
  • use extra cookies so that all the information can be stored - the cookie name could have a sequential number at the end. However there should be a hard or configurable setting for the maximum number of cookies to use (1)
  • use a fallback store with higher capacity to store the data. This fallback should also be configurable. Perhaps the fallback could simply be another ITempData, configurable or hardcoded.

(1) according to http://stackoverflow.com/questions/1131867/can-one-domain-have-multiple-cookies there are a limit in the number of cookies per site between of at least 50, depending on the browser, although I don't know if this is for session cookies or for permanent cookies. This should be taken into account. If the maximum number of cookies is configurable, the developer can keep some extra cookies for other uses in his domain.

@brockallen
Copy link
Owner

These are all great suggestions. Perhaps a global configuration to allow the app to decide?

@marchy
Copy link

marchy commented Jan 18, 2014

What is the current behaviour when this size limit is breached? Is the temp data corrupt? Not stored at all?

PS: I love approach #2 above, with perhaps a configurable max number of cookies to set (ie: 5-10).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants