id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux 27328,return `Set-Cookie` if sessionid= None value,Ramin Farajpour Cami,nobody,"Hi, i use request AJAX, when i haven't sessionid i can send request i see response {{{ POST http://IP/session HTTP/1.1 Host: IP Connection: keep-alive Content-Length: 0 Accept: application/json, text/javascript, */*; q=0.01 Origin: http://IP X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36 X-CSRFToken: BF8nOVWsMJaX9Gi3aJijGSO97iTyLpNY Referer: http://172.16.20.141/ramin Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.8 Cookie: sessionid=;csrftoken=BF8nOVWsMJaX9Gi3aJijGSO97iTyLpNY }}} you see here `Cookie: sessionid=;csrftoken=BF8nOVWsMJaX9Gi3aJijGSO97iTyLpNY` sessionid is ` sessionid=` send to django server {{{ HTTP/1.1 200 OK Date: Sun, 09 Oct 2016 08:17:15 GMT Content-Type: application/json Connection: keep-alive Set-Cookie: sessionid=; expires=Thu, 01-Jan-1970 00:00:00 GMT; Max-Age=0; Path=/ Content-Length: 18 }}} set `Set-Cookie: sessionid=; expires=Thu, 01-Jan-1970 00:00:00 GMT; Max-Age=0; Path=/` in response django i see your code [https://github.com/django/django/blob/master/django/http/cookie.py#L74] in if `val` is empty , you need change `or` to `and`, ",Cleanup/optimization,closed,contrib.sessions,1.10,Normal,needsinfo,,Collin Anderson,Unreviewed,1,0,0,0,0,0