Closed woodensquares closed 1 year ago
Can you verify that a _SESSION cookie is being sent in the browser login request?
it is sent along with the _token POST parameter, and looks somewhat like this:
_SESSION=QRM7uzQkrXD3nhW+ynw8RguXZW73j8ZZH950pKGgYkj/juLWPwgK9zPobrPHwt7Rtky1FGmFgkitBZZ/pZAN+VVC7qD3ZAHsvo0p0Np2BU76ZbFgklYz8VLKAZcNDoIBTJAEfGL+AdO3fgkDyZcPX634vpCmjdndF5xq2YmG53QV48pZszjUHxzrpmsQdxfzgX5TcHUShCTolmB9NQaYMZ8kEVsqTgJwCAAoCq+J;
It contains an encrypted form of the _token
POST parameter; the two values must match
sorry for the delay, looking at the network inspector in firefox I do see the login page trying to set the cookie
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Thu, 22 Jan 2015 15:22:38 GMT
Server: Warp/3.3.23
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
Set-Cookie: _SESSION=CT7KFoh+4QIdSKXnJTxebMGbmLgctMTbrzsIMGpWD5YdY/RBR9YsmqqFBW1qrYzubUYMvFai70+ggQnX47oW3j2+afh5g5zvcbbmncxqiU7Yhub9NRsxWj2gvDKqaLwozVNfzxOOKPcgZ4AB4QkD8Br5lU5sW+RY9TBPx5iNrkHbCo9KH+A=; Path=/; Expires=Thu, 29-Jan-2015 15:22:38 GMT; HttpOnly
X-Frame-Options: DENY
Vary: Accept-Encoding, Accept, Accept-Language
X-XSS-Protection: 1; mode=block
Set-Cookie: XSRF-TOKEN=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
Set-Cookie: XSRF-TOKEN=xHi8qcTxlJMbXt4PijcmTVHWHqmTZBMFZbAtnXIk; Path=/
however when doing the login this is not sent
I only see an XSRF cookie sent, not a _SESSION cookie at all.
POST /auth/page/db/login HTTP/1.1
Host: espial.local
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 77
Origin: http://espial.local
Connection: keep-alive
Referer: http://espial.local/auth/login
Cookie: XSRF-TOKEN=xHi8qcTxlJMbXt4PijcmTVHWHqmTZBMFZbAtnXIk
Upgrade-Insecure-Requests: 1
could it be an issue that I only have espial in /etc/hosts (espial.local -> my local network docker container IP) and so HttpOnly cookies maybe are not working correctly?
The Expires
value of the Session cookie sent by the server is set to 2015; you may want to try correcting the system time on the host first.
duh, good catch! I did not notice that, I forgot to update the clock last week when I had to shut down for a power outage. After setting the clock correctly everything works. Thanks!
I have installed espial via docker compose on my docker running box, however I cannot log in due to XSRF errors. This is my docker compose file (note the image name is a local copy of your image that I docker save / docker import here, as my docker box does not have access to the internet, but only to the local network, which is mynet2 here).
when I try to log in via a browser I get an XSRF error, which I also see in the docker log
I have tried this both with firefox and safari with identical results. Is something else I should be configuring? Is there any way to disable XSRF protection etc. (this is just in my local network which only I use, so I am not too worried about XSRF).