Implement local authentication and cookie sessions