Hi,
may be a fairly redundant question, as i realize this is not much of a
problem as it is lack of knowledge and capability to find some useful
information on the net;
setting a cookie is easy enough, as i did:
cookies[“survey_#{@survey.id}”] = {:value => ‘abc’}
which works fine, as i checked my browser, and it saved it perfectly.
i was wondering how i check if the user has that cookie or not.
say, in the rhtml i want to block some code if the user has this cookie,
namely:
<% if cookie[“survey_#{@survey.id}”] -%>
…you can’t reach this, you already did the survey…
<% else -%>
…blockofcode
<% end -%>
but unfortunately the cookie[…] doesn’t work. how do i check if a user
has a cookie set in his browser or not?
many thanks for an answer or a lead;
thx,
harp