# How to get memcached key-value from cookie in nginx?

**URL:** <https://www.ruby-forum.com/t/how-to-get-memcached-key-value-from-cookie-in-nginx/209981>\
**Category:** NGINX\
**Created:** [July 27, 2011, 2:54pm UTC](https://www.ruby-forum.com/t/how-to-get-memcached-key-value-from-cookie-in-nginx/209981 "2011-07-27T14:54:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [July 27, 2011, 2:54pm UTC](https://www.ruby-forum.com/t/how-to-get-memcached-key-value-from-cookie-in-nginx/209981/1 "2011-07-27T14:54:51Z")

</div>

hello everybody.  
I had a problem, it confused me long time .  
That is how to get memcached value from cookie by httprequest.  
I understand how to get memcached value in Python, but does ngixn  
supports  
get memcached value from cookie?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 29, 2011, 4:15pm UTC](https://www.ruby-forum.com/t/how-to-get-memcached-key-value-from-cookie-in-nginx/209981/2 "2011-07-29T16:15:16Z")

</div>

Hi,

You could try agentzh’s memc-nginx-module

> **[GitHub - openresty/memc-nginx-module: An extended version of the standard...](https://github.com/openresty/memc-nginx-module)**
>
> An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands. - GitHub - openresty/memc-nginx-module: An extended version of the standard me...

maybe you can download from:  
[http://agentzh.org/misc/nginx/ngx\_openresty-1.0.4.1rc6.tar.gz](http://agentzh.org/misc/nginx/ngx_openresty-1.0.4.1rc6.tar.gz)

A sample configure get value from cookie A;

```
   location /foo {
        set $memc_key $cookie_A;

        # $memc_cmd defaults to get for GET,
        # add for POST, set for PUT, and
        # delete for the DELETE request method.

        memc_pass 127.0.0.1:11211;
    }

```

curl -b A=key [http://localhost/foo](http://localhost/foo)

liseen
