improved session parse