# HttpUseridModule

**URL:** <https://www.ruby-forum.com/t/httpuseridmodule/221555>\
**Category:** NGINX\
**Created:** [July 19, 2012, 10:18am UTC](https://www.ruby-forum.com/t/httpuseridmodule/221555 "2012-07-19T10:18:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [July 19, 2012, 10:18am UTC](https://www.ruby-forum.com/t/httpuseridmodule/221555/1 "2012-07-19T10:18:51Z")

</div>

Hi,

I am trying to use the HttpUseridModule but I am not able to set the  
cookie, however I can see that the request has been sent and the browser  
allows cookie.

$uid\_got $uid\_set  
- uid=4D01310AD0BA0750254E223402040303  
- uid=4D01310AD3BD0750D54FFDA202050303

Below you can see the conf that I used in the test. Is there something  
missing?

server {  
listen 80;  
server\_name boo;

```
# log files
access_log /etc/nginx/logs/access.log;
error_log /etc/nginx/logs/error.log warn;

# directory
root /home/test/public_html/boo;
index index.html;

location / {
  userid on;
  userid_name uid;
  userid_domain example.com;
  userid_path /;
  userid_expires 365d;
  userid_p3p 'policyref="/w3c/p3p.xml", CP="CUR ADM OUR NOR STA 

```

NID"’;  
}

```
error_page 401 403 404 /40x.html;
error_page 500 502 504 /50x.html;

```

}

/Ollivera

---

<div class="post-metadata">

**Author:** ![Flavio\_Oliveira](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ed8c4c/32.png) [@Flavio\_Oliveira](https://www.ruby-forum.com/u/Flavio_Oliveira)\
**Post date:** [July 19, 2012, 3:15pm UTC](https://www.ruby-forum.com/t/httpuseridmodule/221555/2 "2012-07-19T15:15:14Z")

</div>

Hello!

On Thu, Jul 19, 2012 at 08:18:31AM +0000, Flavio Oliveira wrote:

> Below you can see the conf that I used in the test. Is there something missing?
> 
> server {  
> listen 80;  
> server\_name boo;

[…]

> ```
> userid_domain example.com;
> 
> ```

The “[example.com](http://example.com)” isn’t likely to work here unless you indeed use  
[example.com](http://example.com) hostname to access your site. Though different server\_name  
suggests you don’t.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Flavio\_Oliveira](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ed8c4c/32.png) [@Flavio\_Oliveira](https://www.ruby-forum.com/u/Flavio_Oliveira)\
**Post date:** [August 15, 2012, 9:09am UTC](https://www.ruby-forum.com/t/httpuseridmodule/221555/3 "2012-08-15T09:09:14Z")

</div>

Hi,

Is it possible to extend the cookie lifetime (expiration time for the  
cookie)?

I would like to set short periods (userid\_expires 2h) and extend that  
(for more 2 h) if the session is still active.

Regards, Flavio

---

<div class="post-metadata">

**Author:** ![Flavio\_Oliveira](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ed8c4c/32.png) [@Flavio\_Oliveira](https://www.ruby-forum.com/u/Flavio_Oliveira)\
**Post date:** [January 16, 2014, 8:20pm UTC](https://www.ruby-forum.com/t/httpuseridmodule/221555/4 "2014-01-16T20:20:57Z")

</div>

Flavio,

I’m trying to do the same as you.

Have you found any solution?

I was thinking in change the expiration by myself setting the cookie  
again, but I think that this is ugly =/

Thank you,

Gabriel Arrais
