Je n'arrive pas a lire un cookies

rids94 Messages postés 49 Statut Membre -  
rids94 Messages postés 49 Statut Membre -
Bonjour,pour mon 1er message help meeeeeeeeeeeeee
comment lire un cookie
svp aidezzzz moiiiiiiii

function Get_Cookie(name,defvalue) {
var start = document.cookie.indexOf(name+"=");
var len = start+name.length+1;
if ((!start) && (name != document.cookie.substring(0,name.length))) return defvalue;
if (start == -1) return defvalue;
var end = document.cookie.indexOf(";",len);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(len,end));
}

function Get_Cookie_Internal(name) {
var start = document.cookie.indexOf(name+"=");
var len = start+name.length+1;
if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
if (start == -1) return null;
var end = document.cookie.indexOf(";",len);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(len,end));
}

function Set_Cookie(name,value,expires,path,domain,secure) {
document.cookie = name + "=" +escape(value) +
( (expires) ? ";expires=" + expires.toGMTString() : "") +
( (path) ? ";path=" + path : "") +
( (domain) ? ";domain=" + domain : "") +
( (secure) ? ";secure" : "");
}

function Delete_Cookie(name,path,domain) {
if (Get_Cookie(name)) document.cookie = name + "=" +
( (path) ? ";path=" + path : "") +
( (domain) ? ";domain=" + domain : "") +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

var today = new Date();
var zero_date = new Date(0,0,0);
today.setTime(today.getTime() - zero_date.getTime());

var todays_date = new Date(today.getYear(),today.getMonth(),today.getDate(),0,0,0);
var expires_date = new Date(todays_date.getTime() + (8 * 7 * 86400000));

var storedmaster = false;

function storeMasterCookie() {
if (!storedmaster)
{
if (!Get_Cookie('MasterCookie'))
Set_Cookie('MasterCookie','MasterCookie');
}
storedmaster = true;
}

function storeIntelligentCookie(name,value) {
if (Get_Cookie_Internal('MasterCookie')) {
var IntelligentCookie = Get_Cookie_Internal(name);
if ((!IntelligentCookie) || (IntelligentCookie != value)) {
Set_Cookie(name,value,expires_date);
var IntelligentCookie = Get_Cookie_Internal(name);
if ((!IntelligentCookie) || (IntelligentCookie != value))
Delete_Cookie('MasterCookie');
}
}
}

A voir également:

3 réponses

rids94 Messages postés 49 Statut Membre 11
 
ou etes vous
0
Utilisateur anonyme
 
il est trop balaiz ton code, cé toi qui l'as fait ?,

sinon, pose ta question aussi dans http://www.developpez.com, tu augmenteras tes chances
0
rids94 Messages postés 49 Statut Membre 11
 
ou etes vouuuuuuuussssssssss plzzzz
0