How about for the rest of the lines?
Main Topics
Browse All TopicsAnyone know why this javascript is not setting a cookie?
Also is the cookie being set to expire after 1 minute?
<script type='text/javascript'>
setTimeout('setCookie('jsD
function setCookie(NameOfCookie, value) {
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireD
document.cookie = NameOfCookie + '=' + escape(value) + '; expires=' + ExpireDate.toGMTString());
</SCRIPT>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
This still doesn't set a cookie unfortunately.
<script type='text/javascript'>
setTimeout('setCookie(\'js
function setCookie(NameOfCookie, value) {
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireD
document.cookie = NameOfCookie + '=' + escape(value) + '; expires=' + ExpireDate.toGMTString());
</SCRIPT>
also have an extra ) at the end if the last line of code
setTimeout('setCookie(\'js
function setCookie(NameOfCookie, value) {
var ExpireDate = new Date();
ExpireDate.setTime(ExpireD
document.cookie = NameOfCookie + '=' + escape(value) + '; expires=' + ExpireDate.toGMTString();
}
Business Accounts
Answer for Membership
by: steveberzinsPosted on 2007-05-25 at 16:48:00ID: 19160485
most likely because you're using single quotes in a single quote wrapped string.
P','1');', 1000); P','1');", 1000); DP\',\'1\' );', 1000); P","1");', 1000); DP\",\"1\" );", 1000);
setTimeout('setCookie('jsD
should be:
setTimeout("setCookie('jsD
or
setTimeout('setCookie(\'js
or
setTimeout('setCookie("jsD
or
setTimeout("setCookie(\"js
you can't use the same quote type (single/double) in a string wrapped in that same quote type, without escaping it.