The Cookie|cookies|javascript| tutorial cookie is a small piece of information that the browser stores to help identify the user. Setting up and checking cookies in a form requires two files to complete. The first file is cookie1.html, and this file requires some mechanism (a button in the example below) to check if a cookie exists and then redirect it to the form page or the document download page. And the second file, the form page (cookie2.html), is also important because you're going to use a little bit of JavaScript to set up cookies, which is done before submitting the form. Here's a file:
First file (cookie1.html)
<HTML>
<HEAD>
<script language= "JavaScript" >
<!--
function Cookieredirect (Hascookieurl, Nocookieurl)
{
var currentcookie = Document.cookie;
if (Currentcookie.indexof ("Formcomplete=yes")!=-1) {
To test this feature, you can open the cookie1.html and click the hit button, and you will be taken to the form page. If you go back to the cookie1.html file and click on the button you will be directly connected to the document.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.