Django : In a view how do I obtain the sessionid which will be part of the Set-Cookie header of following response?

StackOverflow https://stackoverflow.com/questions/3053923

Question

In case of views that contain login or logout,
this sessionid is different from the one submitted in request's Coockie header.
I need to retrieve it before returning response for some purpose.
How can I do this ?

Was it helpful?

Solution

I think you should be able to access this via request.session.session_key

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top