Y
Yonih
Hey Yall,
I am trying to incorporate a Once Per session Cookie that will expire
once the browser is closed so some one who comes to my website will
see my popup the first time her visits the website but it wont keep
showing as one navigates throughout the site however if he closes the
browser and reopens out site it will show again. Here is the script
that I was using that started out to work once per session but after
publishing the site it went to once per machine (until I cleared my
cookies)
Please let me know how to change it or what code I can use.
//This calls onlyOnce Code
onLoad="onlyOnce()
<script type="text/javascript">
// initpopup is my Popup Script
function initpopup() {
window.open(initpopup())
}
</script>
<script type="text/javascript">
// the new code
function onlyOnce() {
if (document.cookie.indexOf("hasSeen=true") == -1) {
var later = new Date();
later.setFullYear(later.getFullYear()+10);
document.cookie =
"hasSeen=true;expires="+later.toGMTString();
// call the old function
initpopup();
}
}
</script>
Please let me know if you know a way to change this to a once per
session script or if you have a new one to use.
Thanks
Yoni
I am trying to incorporate a Once Per session Cookie that will expire
once the browser is closed so some one who comes to my website will
see my popup the first time her visits the website but it wont keep
showing as one navigates throughout the site however if he closes the
browser and reopens out site it will show again. Here is the script
that I was using that started out to work once per session but after
publishing the site it went to once per machine (until I cleared my
cookies)
Please let me know how to change it or what code I can use.
//This calls onlyOnce Code
onLoad="onlyOnce()
<script type="text/javascript">
// initpopup is my Popup Script
function initpopup() {
window.open(initpopup())
}
</script>
<script type="text/javascript">
// the new code
function onlyOnce() {
if (document.cookie.indexOf("hasSeen=true") == -1) {
var later = new Date();
later.setFullYear(later.getFullYear()+10);
document.cookie =
"hasSeen=true;expires="+later.toGMTString();
// call the old function
initpopup();
}
}
</script>
Please let me know if you know a way to change this to a once per
session script or if you have a new one to use.
Thanks
Yoni