Jump to content
mboehler3

Set cookie onclick

Recommended Posts

I'm trying to set a cookie for a user *only* when they click a certain link. My code is in ASP.The code I'm using looks like this:

<a href="/backend/" rel="external" id="footlink" onclick="<% Response.Cookies("mobile") = "Full"			    Response.Cookies ("mobile").Expires = DATE + 30%>"> Full Site </a>

But it's not working, it's setting the cookie even though the link isn't clicked. What can I do to fix this?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...