Added full login, logout, and session functionality with PHP.