I only know one way to do it, programming an extension that check DRAFT and PUBLISH content actions and decide what to do with the session data, i.e : destroy session variables
On the other hand you may also have code that start new session variables when content object is created( don't remember which content action is)
If that's really the only way (and there's not a POST variable or some such that indicates this reliably) I'll rather find another way to keep state ;-). It's only a list of ints anyhow, so I can put them on the form too.