When users log into our site we retrieve an object from our database that contains various settings that are used throughout the site. In order to reduce server load from going back to our database each time the user interacts with our site, we are trying to think of alternative ways. (We serialize and de-serialize the object, when needed). The object is likely to be <1MB but could vary.
Well, take a look. That small cookie scoop is less than an ounce of dough and the baked cookie is about 2-inches in diameter. The medium cookie scoop is 1.25 ounces of dough and yields a 3-inch cookie. And that behemoth cookie scoop and it's 2.25 ounces of dough is going to give you a very hearty 4-inch cookie.
For softer, chewier cookies, bake for the shorter amount of time indicated in the recipe. When placing dough on cookie sheet, allow sufficient space between cookies, usually 1-1/2 to 2 inches unless recipe directs otherwise.
A medium cookie scoop, the Goldilocks size for most bakers, is often a #30 or #40, which dispense 2 tablespoons and 1.6 tablespoons of dough, respectively. I favor a medium-size scoop for my peanut butter, chocolate chip, gingerbread, and oatmeal raisin cookie needs.
The maximum allowed cookie size depends on the client. For example, a MSDN article from 2005 says that the whole cookie may have at least 4096 bytes available (including expiry date etc). The RFC mentioned in the same article contains some more information regarding limitations:
6.3 Implementation Limits
Practical user agent implementations have limits on the number and size of cookies that they can store. In general, user agents' cookie support should have no fixed limits. They should strive to store as many frequently-used cookies as possible. Furthermore, general-use user agents should provide each of the following minimum capabilities individually, although not necessarily simultaneously:
at least 300 cookies
at least 4096 bytes per cookie (as measured by the size of the characters that comprise the cookie non-terminal in the syntax description of the Set-Cookie header)
at least 20 cookies per unique host or domain name
If your session data is not valuable (as in "shouldn't be lost in case of e.g. a reboot"), consider storing it in memcached. This is pretty fast and avoids accessing the DB just to get session data. You might actually want to consider using a mix of both: You could create a small cookie containing the session id and login information. Then a loss of your server-side sessions would not result in users being logged out so the impact would be pretty low.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With