Fix session expire function