I am working on a homemade vending machine project that serves milk and cookies, using arduino and some basic servos and stuff.
The problem is: I really have no clue on how to protect the milk to last long, or how to even know if the milk is still ok to drink.. All I really know is that air is bad for the milk (and the cookies), so here is what I came up with:

Two solenoids that activates at the same time, to allow air in, and milk out. All of this should be inside a "slightly" colder place.
I'm sure this design might sound stupid to some of you, but this is where I need your help please, do you think this design can work ? (Would that solenoid on top make any difference to protect milk?) How to improve it to make the milk last as long as possible ?
I'v heard about the big guys making machines that keep milk fresh for weeks even months, while i'm probably sure my milk won't stand a couple of hours..
Any idea or any information, link, or clue would be greatly appreciated. Thank you.
