Also make the session available in publish functions.