Cookies

They have: 21 posts

Joined: Mar 2000

Hello,

Anyone know the answer to these questions? Are all cookies javascript based (excluding the use of ASP servers)? So if javascript is disabled in the browser does this mean cookies are disabled also?

A page needs to detect a cookie set on a previous visit. If the cookie is not there the page will set the cookie. If the cookie is there the page will only read it, not set it again. What's the javascript?

Thanks

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Hey Max,

No, all cookies are not javascript based. But they can all be turned off by the browser.
You can set cookies in most any language (JS,ASP,PHP,Perl,etc.).

As for Javascript cookies, try these links:
http://webmaster-forums.com/showthread.php?threadid=12060
http://webmaster-forums.com/showthread.php?threadid=12792

Good Luck,

Mark Hensler
If there is no answer on Google, then there is no question.

They have: 21 posts

Joined: Mar 2000

Thanks for the reply. I looked at the scripts in those threads but couldn't make enough sense of them, lol. I was hoping somebody knew a somewhat standard script for that which I could basically cut and paste, for the most part. Looked the web over didn't find something like that. lol, you see, Im not the custom coding Javascript extraordinaire superhero type. I struggle with it and sometimes fiddle and smile widely when the fiddling works. I know you people have better things to do. But if you know of anything let me know would ya. I'll tip my hat to you. That in itself is a beautiful thing.

Thanks.

They have: 12 posts

Joined: Oct 2000

Can you alter this to your specifications ?

<script LANGUAGE="JavaScript">
0)
date.setTime(date.getTime() - skew)
}

var now = new Date()
fixDate(now)
now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000)
var visits = getCookie("replied")
if (!visits)
document.write('This is where to put whatever you want it to do if the cookie DOES NOT existThe cookie has now been set so the next time you visit this page, you will get a different message.')
else
document.write('This is where to put whatever you want it to do if the cookie exists')
setCookie("replied", visits, now)

// -->
</script>

I had nothing better to do tonight !

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.