Jump to content

Set cookie onclick


mboehler3
 Share

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?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...