some php functions for session stuff