Changed how to handle session cookies