How to use Coookies

When i used authenticate by session in view i used this code
<code>
<% if @user.id != session[:id]%>
<%= link_to 'Отправить Сообщение',
          :controller => 'users',
          :action => 'messages',
          :id => @user,
          :anchor => 'send_message'
          %>
<% end %>
</code>

Now i authenticated user by cookies, how can i change above code for
it'll work