Empty Cart when user logs in

Hey first off thanks for the code you released.It's amazing what you can do with it.

I'm wondering if there is a quick way to empty the cart when a user logs in or out.

Right now the cart data seems to be persistant unless you empty the cart or finish the order.

Thanks in advance.

Glenn Tooth