How to use Coookies

When i used authenticate by session in view i used this code

<% if @user.id != session[:id]%>
<%= link_to ‘ïÔÐÒÁ×ÉÔØ óÏÏÂÝÅÎÉÅ’,
:controller => ‘users’,
:action => ‘messages’,
:id => @user,
:anchor => ‘send_message’
%>
<% end %>

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