I’m using Django and I need to be able to check if the client has an
active session on the server from a javascript script. Is there a way to check if the client has a valid django session key cookie from javascript ?
I’m using Django and I need to be able to check if the client
Share
The first time you request a page from the Django site, it should send you a cookie which should start a session if Django is set up properly. The name of the cookie will be
sessionid.To see if this cookie exists you can do
if (document.cookie.indexOf("sessionid") >= 0)If you want to see/confirm more details you will have to use an Ajax request to the server.