WordPress cookies

Cookies are set on the session BEFORE the page starts to load.
Therefor – This function will set the cookie for the NEXT time the page is requested.

you can not (as far as I know ) set a cookie onclick without any javascript help, becasue when at the time the page is rendered (and your click button) – all the cookies are already set.

If you are familiar with jQuery – there are some very good plugins that can help you set a cookie via JS and “refresh” the cookies session.
Some of them , will actually refresh the cookie in a way that will trigger also the “normal” wp cookie to be updated .