View Full Version : how to create cookie
ugnakr86
03-12-2014, 07:44 AM
how to create cookies
Neo.Reeves
03-13-2014, 01:44 PM
Ugnakr you posted this thread two times...
arianagrand
03-18-2014, 06:52 AM
function setCookie(cname,cvalue,exdays)
{
var d = new Date();
d.setTime(d.getTime()+(exdays*24*60*60*1000));
var expires = "expires="+d.toGMTString();
document.cookie = cname + "=" + cvalue + "; " + expires;
}
jackthomas087
03-27-2014, 09:34 AM
Here are functions you can use for creating and retrieving cookies.
var createCookie = function(name, value, days) {
var expires;
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toGMTString();
}
else {
expires = "";
}
document.cookie = name + "=" + value + expires + "; path=/";
}
function getCookie(c_name) {
if (document.cookie.length > 0) {
c_start = document.cookie.indexOf(c_name + "=");
if (c_start != -1) {
c_start = c_start + c_name.length + 1;
c_end = document.cookie.indexOf(";", c_start);
if (c_end == -1) {
c_end = document.cookie.length;
}
return unescape(document.cookie.substring(c_start, c_end));
}
}
return "";
}
Bharti Mahour
08-23-2014, 09:02 AM
You need to use this code as mentioned below
function setCookie(cname,cvalue,exdays)
{
var d = new Date();
d.setTime(d.getTime()+(exdays*24*60*60*1000));
var expires = "expires="+d.toGMTString();
document.cookie = cname + "=" + cvalue + "; " + expires;
}
akashram
09-08-2014, 02:16 AM
function getCookie(name) {
var name = name + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1);
if (c.indexOf(name) != -1) return c.substring(name.length,c.length);
}
return "";
}
Olin Lamanna
11-18-2014, 03:28 AM
Cookies are created when you use your browser to visit a website that uses cookies to keep track of your movements within the site.
StuartSpindlow
11-25-2014, 04:05 AM
Yes, I agree with Olin Lamanna. You said absolutely right.
divorceclass
12-09-2014, 03:49 AM
I don't have any idea about this dear.
harry26
12-11-2014, 03:27 AM
you need to know more about PHP function then you have to start a program on cookie.
novaco112
12-13-2014, 01:33 AM
Cookies are bits of data that a web browser stores on your visitor's computer. They can be very useful if you need to store things like your visitor's preferences or login data or other things that are specific to a particular visitor.
chrisgeitz
12-17-2014, 07:30 AM
When a web server has sent a web page to a web browser, the connection is shut down, and the server does not remember everything about the user.
novaco112
01-01-2015, 07:39 AM
A cookie, also known as an HTTP cookie, web cookie, or browser cookie, is a small piece of data sent from a website and stored in a user's web browser while the user is browsing that website.
divorceclass
01-23-2015, 06:16 AM
To create cookies you can use this code.
{
var d = new Date();
d.setTime(d.getTime()+(exdays*24*60*60*1000));
var expires = "expires="+d.toGMTString();
document.cookie = cname + "=" + cvalue + "; " + expires;
}
chrisgeitz
08-04-2015, 09:24 AM
A cookie, also known as an HTTP cookie, web cookie, or browser cookie, is a small piece of data sent from a website and stored in a user's web browser while the user is browsing that website. Every time the user loads the website, the browser sends the cookie back to the server to notify the website of the user's previous activity.
lifsizedolls
08-06-2015, 04:13 AM
JavaScript can create, read, and delete cookies with the document.cookie property.
With JavaScript, a cookie can be created like this:
document.cookie="username=John Doe";
callforassist
08-14-2015, 08:08 AM
Create a Cookie with JavaScript. JavaScript can create, read, and delete cookies with the document.cookie property. With JavaScript, a cookie can be created
Powered by vBulletin® Version 4.2.4 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.