How to savie  user preference like Page size in web application

TrialUser used Ask the Experts™
In my web site user has the option to choose Record Size. I would like to save this so that when the user comes to the website next time we can automatically use this information. what is the best way to store this.

Should I store this as a cookie or should i store this in db.?

Also what about 2 scenarios when they are logged in and not logged in. Please help
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2014
For registered users who are logged in, DB is the best place in my opinion. For guest users, Cookies can be used.
What kind of record are we talking about? If it's a non-sensitive piece of information you might as well store it in a cookie. Then it doesn't matter if the user is logged in or not, you can still read the same cookie.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial