Cookie set on beresp not present on next request

Torben Pedersen torbped at gmail.com
Thu May 10 21:53:47 CEST 2012


On 10/05/2012, at 21.25, Lasse Karstensen wrote:

> Torben Pedersen:
>> Hi,
>> I'm trying to use Varnish + a cookie to control access from mobile devices. I've seen other people doing similar, but I can't get it to work.
> [..]
>> Set-Cookie:nomobile=1; expires: Session; path=/; domain=.
>> This seems to be correct. So now I call
>> https://<server>
>> And I expect not to get redirected since the Set-Cookie is present. But the nomobile=1 is not present in request / Cookie. I don't quite get why ?
>> Any ideas ?
> 
> The "domain=." part stands out a bit. Are you sure this is accepted by the
> browser? Is the Cookie included on the next request?
> 
> As a reference you can check out the documentation for device detection
> in Varnish:
> https://www.varnish-cache.org/docs/trunk/tutorial/devicedetection.html
> https://github.com/varnish/varnish-devicedetect/
> 
> -- 
> Lasse Karstensen
> 
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Hi,

You're most likely correct Lasse. Now I've changed the solution a bit - because it wouldn't work since I was trying to delete the cookie. Now I'm changing the value of the cookie instead - for controlling access (thanks to Daniel S)

(I'm using nginx in front of Varnish in this solution for the https)

Thanks for all the replies.

kind regards

 Torben


More information about the varnish-misc mailing list