A new session starts when a user is idle for more than 30 minutes. Create sessions with user_id, session_no (1, 2, … per user), started_at and clicks.
Each hint gives a little more help. Try on your own first.
Run your code to see the output here.