Questions tagged [http-cookie]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
792 views

Check HTTP cookie value with nginx using map directive

I need to perform a redirect depending on the client's IP and the value that has been set in the cookie by WPML Wordpress plugin. I prefer to use the map directive for this purpose. Excerpt of nginx....
0 votes
0 answers
6 views

controlling apache target using cookie

I have an apache web server with authentication based on mod_mellon mode (IDP OKTA). Authentication is done only on the Uri "/example". Everything is OK on authentication. Post-...
  • 101
-1 votes
1 answer
712 views

Apache Reverse Proxy - HTTP requests with a Cookie

We have an Apache Reverse Proxy which works fine (configuration below). Now we have the need to forward a few requests to another server (server3.domain.com) and check that a cookie named "...
  • 3
0 votes
1 answer
2k views

NGINX load balancing hash: use cookie value if present, ip_hash if not

I'm trying to figure out how to do some if-else logic in NGINX's upstream load-balancing directive. Basically, I'd like to use the method: hash $cookie_my_cookie_name consistent; ... if the cookie (...
  • 125
1 vote
1 answer
992 views

How to protect against session hijacking in Flask [closed]

So, i'm developing a Flask web-app and i wanted to test its security since i've implemented the following: SSL Cert with cookies being securely transmitted CSRF token to avoid CSRF attacks Cookie ...
0 votes
1 answer
393 views

Transform Apache Cookie logs to json with rsyslogd

I am logging cookie headers, some cookies may have due date, some others not, the same is tru for other cookie parameters, I need to implement a centrilaized logging, so before sending those to ...
2 votes
0 answers
1k views

Cookies aren't being set/overwritten through nginx reverse proxy

For some reason, when I'm proxying my API request through an nginx reverse proxy, my cookies aren't being overwritten with the new values. I've tried adding the following to my nginx config, but I'm ...
1 vote
1 answer
1k views

Why HTACCESS RewriteCond %{HTTP_COOKIE} only for php and not working for html?

I was trying to redirect all direct access in my subfolder using this code RewriteEngine on RewriteCond %{HTTP_COOKIE} !user_cookie=[^;] RewriteRule .* http://webhost.org/ [R=301,L] I realise it ...
  • 11
3 votes
1 answer
15k views

What is the difference between http_cookie and cookie_name in Nginx?

I want to add remote ip as a Cookie in Nginx, so that it can be passed on to AWS Load Balancer for Load balancer stickiness. location / { proxy_set_header Cookie "$http_cookie; ip=$remote_addr"; ...
1 vote
0 answers
2k views

write condition if cookie doesn't exist not working

Ref: Correct way to block a site if a cookie isn't present apache 2.4 We followed the answer and it didn't work. We want to redirect to another page when the cookie does NOT exist (or contain ...
  • 11
3 votes
2 answers
2k views

How do I prevent nginx from stripping secure cookies?

We're setting the secure flag on our cookies and nginx is refusing to transmit them because we're communicating with it over HTTP. This is perfectly understandable, as that is the expected behavior. ...
1 vote
1 answer
4k views

How to use a hyphen in cookie names for nginx?

I want to use the new cookie-prefixes, which are not yet standardized by the IETF. These are __Secure- and __Host-. So let's e.g. set this cookie (here the header returned by the server): Set-Cookie: &...
  • 486
0 votes
1 answer
2k views

Correct way to block a site if a cookie isn't present apache 2.4

I'm using apache 2.4.12 (Ubunutu 15.10) as an oauth2 proxy behind a node app. The app sends lots of unauthenticated requests before login b/c it doesn't know it's not authenticated (it doesn't know/...
  • 53
1 vote
2 answers
1k views

nginx -> serve different files using try_files based on cookies (conditions, if, then, else)

I need to configure an nginx server so that: If user has a specific cookie so the server must send a file, else the server must send another one. I read plenty of related articles, but nothing helped, ...
0 votes
1 answer
4k views

NGINX cache based on cookies

Is there a way for NGINX to have a different cache depending on the value of a cookie? In my case, I have a website (in my case, a plugin) that creates a cookie called devicePixelRatio. This is 1 in ...
1 vote
0 answers
2k views

HAproxy ACL based on backend application session cookie to replace HTTP Basic Auth

I would need some help on HAproxy configuration to bypass HTTP basic auth and let the user use a specific backend in case there is a valid session cookie present from another backend application. I ...
2 votes
1 answer
1k views

Conditionally serving high resolution and WebP images with nginx

Not sure if I'm trying to pull off the impossible, but I'm wanting to configure Nginx to serve ".webp" files to browsers that support the file format and serve fallback files (i.e. pngs, jpgs, etc.) ...
  • 285
4 votes
4 answers
24k views

Adding "HttpOnly" and "Secure" cookie flags on Nginx & PHP

I have Nginx running with PHP and WordPress. Acunetix recommends setting these flags, but they provide no documentation. I have looked around a bit, but I have not seen anything that shows exactly how ...
0 votes
1 answer
6k views

Can Apache clean cookies from a request to specific URLs?

We have the following configuration: <Directory /docs> AuthFormAuthoritative Off AuthType None Allow from all Satisfy any Options FollowSymLinks </Directory> Problem: ...
  • 597
4 votes
2 answers
35k views

checking and reading cookies with nginx

I can't find many resources on how to manage cookies with Nginx… I've seen that two variables are relatives to cookies, that is $http_cookies and $cookie_COOKIENAME. Anyway, I absolutely don't know ...
  • 775
0 votes
1 answer
1k views

Why can't Windows Server 2008 create cookies?

Scenario: I have a web application (SnapshotServer) which uses a WebBrowser control to take a snapshot images of a web page. I use a WebBrowser control within SnapshotServer to navigate to a entry ...
  • 137
6 votes
2 answers
8k views

How to make Varnish ignore, not delete cookies

I want to use Varnish to cache certain pages even in the presence of cookies. There are 3 possibilities that I need to take care of: An anonymous user is viewing some page A logged in user is viewing ...
1 vote
1 answer
335 views

How to enable/disable mod_deflate based on a cookie?

I would like to enable mod_deflate based on the presence and value of a certain cookie. I know it’s possible to do cookie manipulation and tests with mod_rewrite, but I’m not sure how to do that kind ...