Updated example with sessions