Get csrftoken at the right time