Moved to database session handling, improved automatic IP update