We have an indoor kitty who loves to run outdoors whenever we open the door. She doesn't go far, but enough that it's hard to retrieve her every time. Whenever I'm bringing in groceries my first task is to go round up the offending kitty and place her in the bedroom until all groceries are secured (she steals groceries, too.) Don't worry, there's always water and food in the bedroom.
There have been several times when I do a big grocery shop, and it takes a while to unload, and I'll often go to the living room to go on the computer or watch TV, and since I'm tired, I'll forget to let the cat out for about an hour. No harm done, she's usually sleeping on my pillow, happy she got the time off from the playful kitten.
I also will sometimes close the door and lock it behind me while my husband is still outside gathering groceries... force of habit!