# Problem to reading Cookies

**URL:** <https://www.ruby-forum.com/t/problem-to-reading-cookies/121977>\
**Category:** Rails\
**Created:** [December 3, 2007, 4:13pm UTC](https://www.ruby-forum.com/t/problem-to-reading-cookies/121977 "2007-12-03T16:13:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stratboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/838e76/32.png) [@stratboy](https://www.ruby-forum.com/u/stratboy)\
**Post date:** [December 3, 2007, 4:13pm UTC](https://www.ruby-forum.com/t/problem-to-reading-cookies/121977/1 "2007-12-03T16:13:50Z")

</div>

I have a problem with rails and cookies. I have created a  
loginController. In this i have inserted these lines:  
cookies[:uid] = { :value =\> @user.id,:expires =\> 30.days.from\_now};  
cookies[:uhp] = { :value =\> @user.hashed\_password,:expires =\>  
30.days.from\_now };  
puts cookies[:uid]

This print nil.  
Why??  
Thanks
