/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] how do cookies work?

This is one thing with Javascript that I really don’t get, and I have tried and tried to understand….will some of you all tell me in detail how cookies work and maybe provide examples…I also don’t understand how to make the cookie user friendly or how to pull and post the information on a site if I wanted to…please help ?

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@FangJul 14.2008 — The basics: http://www.quirksmode.org/js/cookies.html

Why do you want to use cookies?
Copy linkTweet thisAlerts:
@blade54035authorJul 14.2008 — well there was a hard javascript code that I am still working on (no one on here really helped me) and the problem with it was there was no variables but I thought maybe I can alter a cookie and use the information it holds to make a variable that I can use...if you want I will send you the old code through a message and you could see if you could solve it with out a cookie, but I am not a hundred percent sure that it is possible....but thanks for the link ?
Copy linkTweet thisAlerts:
@FangJul 14.2008 — Still unclear what the cookie is to be used for. Attach the (zipped) document here.
Copy linkTweet thisAlerts:
@blade54035authorJul 14.2008 — um I am not sure how to do that lol....but I will try to put it right here....I think fang that you have tried at this, but I didn't understand it.

well heres one of the JavaScript Files that I created:
{

var dhkskg="a";

var Fdooej="A";

var kdigjs="b";

var Nqwods="B";

var kdoeod="c";

var Iiideo="C";

var bbdoso="d";

var Bwwowe="B";

var bnnods="e";

var BNoopd="E";

var uieygs="f";

var Ryyeod="F";

var owyegb="g";

var Owwwwo="G";

var nnqooe="h";

var Nttoer="H";

var hgyure="i";

var Hqrreo="I";

var zxczxc="j";

var Zxxxcs="J";

var twrqes="k";

var Tyourr="K";

var yucvse="l";

var Yiirro="L";

var poeidj="m";

var Pytyxc="M";

var quvbde="n";

var QaxKpe="N";

var iouuer="o";

var IbbzOP="O";

var tronvf="p";

var Thhdbb="P";

var eoivng="q";

var Eeeeer="Q";

var vneoug="r";

var VvoiRn="R";

var iiunnn="s";

var IHdJrl="S";

var odougu="t";

var ObcurR="T";

var nnbpie="u";

var NpproD="U";

var poiuer="v";

var PqqqeE="V";

var aaaaak="w";

var KKAore="W";

var oooeee="x";

var OppPre="X";

var qwqwqw="y";

var QggdfF="Y";

var ouffff="z";

var OyZqpl="Z";

var opscop=" ";

}
[/QUOTE]



This Script is saved in any flash drive...what the purpose of this script to do is to encrypt the site that I would try to be hiding beyond reading, that way nobody can see the site. now the real site is saved on the net and an example of its source code would be something like this:

<html>

<head>

<script src="file:///E:/html/trans.js"></script>

<script src="file:///C:/Documents%20and%20Settings/Tom/My%20Documents/trans.js"></script>

//this is where it is at on my flash

//drive....you would have to change this acording to where the above file is saved.


</head>

<body bgcolor="#000000">

<div align="center">

<table border="0">

<tr><td>

<script type="text/javascript">


if (opscop=" ")

{

var tap=Pytyxc+qwqwqw;

var tap2=ObcurR+iouuer+tronvf;

var tap3=IHdJrl+bnnods+kdoeod+vneoug+bnnods+odougu;

var tap4=IHdJrl+hgyure+odougu+bnnods;

var tap5="<b>"+tap+opscop+tap2+opscop+tap3+opscop+tap4+"</b>";

var txt=tap5.fontcolor("#00ff33").fontsize(14);

document.write(txt);

}

else

{

var tap6="welcome back to another boring day!";

var txt2=tap6.fontcolor("#00ff33").fontsize(14);

document.write(txt2);

}

</script>

</td></tr>

</table>

</div>

</body>

</html>
[/QUOTE]


And what the goal of this whole this is: If you have the flash drive plugged in then it will show the protected site, but if you don't have the flash drive plugged in then it shows you a completely different site, and the way I have it designed I know that it will be impossible to hack the protected site...And the code above will get as far as letting you view the protected site ONLY if the flash drive is plugged in, but with out the flash drive it shows up completely blank...I know the problem...but I don't know how to fix it.

the problem is with the "if (opscop=" ")" what makes it not work is that when the flash drive is not plugged in then the variable does not exist, in return leaving the site blank instead of showing the other site. What I need to do is try to use the Javascript file as a variable, but I don't know how to do that....So is there anyone you know that could help my?

lol...I have finally given up on trying to figure out this problem by myself.

but I was thinking that maybe I could some how use a cookie as a variable instead.
Copy linkTweet thisAlerts:
@blade54035authorJul 14.2008 — hey Fang, one thing that I noticed is that almost every big question on here has been answered by you...I really think that doing that is really sweet and shows that you know what you are doing...how and what started you off learning all of this?
Copy linkTweet thisAlerts:
@cridleyJul 14.2008 — Hi one thing that will screw up your 'encryption' :

var bbdoso="d";

var Bwwowe="B";

Also this just looks like a substitution cipher which would be pretty easy to crack (and to spot because of the recurring patterns) if somebody actually wanted to.
Copy linkTweet thisAlerts:
@FangJul 14.2008 — if (window['opscop'])

I started off by developing a website for my athletics club.
Copy linkTweet thisAlerts:
@blade54035authorJul 14.2008 — thanks man...that code worked...and is the only one that has worked that any one has suggested....thank you so much!!!!!
×

Success!

Help @blade54035 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...