Cookie dependent

Hi,

I have a button on my page and it links to a page that has a security notice on it, for the user to login the user has to agree that they’ve read this and then they click on the login in process.
Is it possible if the user has read this previously(using cookies) that they are brought to the login page without showing the security page?

The process is as follows:

  1. User clicks login.
  2. Depending on if the user has clicked “I have read this” the user will be brought to the login page… if they have not read the message before then they will be brought to the security page.

Hope this makes sense.
Please any help would be greatly appreciated?

Thanks
David

Hi there,

Welcome to the forums :slight_smile:

Yes, this is entirely possible. Where exactly are you having trouble?

Hi there,
Thank you!

From scratch! I have very little javascript knowledge… Is there any javascript code I could re-use?

Are you using jQuery or plain JS?

the basic cookie: http://www.w3schools.com/js/js_cookies.asp

I prefer: http://www.quirksmode.org/js/cookies.html

better. :slight_smile: now David’s got 2 places to learn from :smiley:

Not necessarily, but I am always a bit cautious recommending W3Schools as a resource.
Maybe you know the site W3Fools, which explains why.

A third option, if the OP is using jQuery already, is to use this plugin.

Wow, I didn’t realize that about W3Schools, I always thought that was a reliable source, thanks for that information…

I will be using jQuery, I have got some help inhouse and we have it working now… :slight_smile:

Thanks very much for your help guys, much appreciated!!

have heard of it; never visited (thought it was simply a parody). I know of w3schools’ problems, but I hesitate to recommend some other sites (mdn, eg) because the info (or the way it’s presented) may be beyond what the user needs or asks for.