Refactored database sessions. Added methods to login with PHPSESSID cookies.