fixed some problems with session lifetime