Cooked or caramalized onions in the refrigerator
For cooked onions, you can find one answer here: http://www.stilltasty.com/fooditems/index/17825


3-5 days in the refrigerator.
refrigerate withing 2 hours of cooking.
refrigerate in covered container or wrap tightly with heavy-duty aluminum foil or plastic wrap.