473,800 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript with expiring cookie

Mo
I am looking for a JavaScript that will allow me to open a pop-up
window "onUnload". The pop-up window should set a cookie on the users
computer that expires in 'n' number of days.
Jul 20 '05 #1
5 1485
Mo wrote:
I am looking for a JavaScript that will allow me to open a pop-up
window "onUnload". The pop-up window should set a cookie on the users
computer that expires in 'n' number of days.


So, after I leave your site, you want to *attempt* to annoy me by
opening yet another ad window?

And *if* I allow the cookie, do I get cyber-milk with it?

Stop trying to annoy people after they have left your site. They are
gone, let them go in peace.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #2
On Sun, 01 Feb 2004 13:35:12 +0000, Randy Webb
<hi************ @aol.com> wrote:
Mo wrote:
I am looking for a JavaScript that will allow me to open a pop-up
window "onUnload". The pop-up window should set a cookie on the users
computer that expires in 'n' number of days.


So, after I leave your site, you want to *attempt* to annoy me by
opening yet another ad window?

And *if* I allow the cookie, do I get cyber-milk with it?

Stop trying to annoy people after they have left your site. They are
gone, let them go in peace.


Well, there are valid uses for this function don't forget, even if
better options could exist.

Just what do you have against cookies by the way? When being able to
recognize what one of your customers it is when they visit your site
has always seemed like a good idea to me, when you can welcome them
with like "Hello Randy, Welcome Back!".

Cardman
http://www.cardman.com
http://www.cardman.co.uk
Jul 20 '05 #3

"Cardman" <do****@spam-me.com> wrote in message
news:om******** *************** *********@4ax.c om...
On Sun, 01 Feb 2004 13:35:12 +0000, Randy Webb
<hi************ @aol.com> wrote:
<trim>
Just what do you have against cookies by the way? When being able to
recognize what one of your customers it is when they visit your site
has always seemed like a good idea to me, when you can welcome them
with like "Hello Randy, Welcome Back!".

Cardman
http://www.cardman.com
http://www.cardman.co.uk


I've always thought that was more creepy than anything else. Anyway,
what has opening a new window got to do with setting a cookie? This
can be done anytime from the main window.

Tim.
Jul 20 '05 #4
On Sun, 01 Feb 2004 22:23:22 +0000, Cardman <do****@spam-me.com> wrote:
On Sun, 01 Feb 2004 13:35:12 +0000, Randy Webb
<hi************ @aol.com> wrote:
Mo wrote:
I am looking for a JavaScript that will allow me to open a pop-up
window "onUnload". The pop-up window should set a cookie on the users
computer that expires in 'n' number of days.


So, after I leave your site, you want to *attempt* to annoy me by
opening yet another ad window?

And *if* I allow the cookie, do I get cyber-milk with it?

Stop trying to annoy people after they have left your site. They are
gone, let them go in peace.


Well, there are valid uses for this function don't forget, even if
better options could exist.


[snip]

The onunload intrinsic event is unreliable and should be avoided. Browsers
consider different things "unload events". For example, I think IE fires
onunload when a page changes, is refreshed, and when the window is closed.
Opera only fires it when the page is changed. I haven't got around to
installing Netscape and Mozilla, so I can't compare them.

Mike

--
Michael Winter
M.******@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #5
On Sun, 01 Feb 2004 23:26:25 GMT, "Tim Williams"
<sa************ @THISpacbell.ne t> wrote:
"Cardman" <do****@spam-me.com> wrote in message
news:om******* *************** **********@4ax. com...
Just what do you have against cookies by the way? When being able to
recognize what one of your customers it is when they visit your site
has always seemed like a good idea to me, when you can welcome them
with like "Hello Randy, Welcome Back!".
I've always thought that was more creepy than anything else.


It can be I guess if you do not know how it works and thought that you
were being spied upon. Like "quick, exit this web page, before it
takes over the web cam and they get to see us naked!". ;-]
Anyway, what has opening a new window got to do with setting a
cookie? This can be done anytime from the main window.


Beats me, but I cannot await the answer.

Cardman
http://www.cardman.com
http://www.cardman.co.uk
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1900
by: Stefan | last post by:
I am using the following code to set a cookie for 30 seconds: $value = $_GET; if (! isset($_COOKIE)){ setcookie('testit',$value,time()+30,'/'); } What happens: 1. On the windows apache server the cookie disappears after 30 seconds 2. On the linux apache server the cookie disappears after hours???? Fact is: Servertime is localtime
3
1401
by: Gav | last post by:
Hi, I have a form which sibmits data to another page. Trouble is when the user refreshes the page it resubmits all the data again. Is there anyway to expire the page immediatly so this cant happen?? gav
6
1431
by: Québec | last post by:
Hi, How do I get back the expires value of a cookie? .... alert(document.cookie.expires) ... Jean Pierre
3
12890
by: Jim Kelly | last post by:
Hi, I'm having a strange problem with setting a cookie's expiration date. The relevant code is as follows: HttpCookie hc = new HttpCookie("MyCookie"); hc.Values.Add("UserName", tbUserName.Text); hc.Expires = DateTime.Now.AddDays(30); Response.AppendCookie(hc);
3
2366
by: Mike | last post by:
I have a web application that the forms authentication cookie is not expiring correctly. When I look at the trace information of a newly requested page after the session and forms authentication have expired the forms authentication cookie is assigned a new value. I am never redirected to the login page after my initial login. If I access the site from http://localhost/myapp instead of myapp.domain.com the cookies expire correctly. The cookie...
2
2744
by: pv_kannan | last post by:
I recently found out that my authentication cookies are not expiring even though I have set the persist property to false. As a result, users are able to access the secure websites with indifferent results. Any pointers/suggestions would be very appreciated. Things were running as usual till until recently. Here are the relevant pieces of code ==========================================
5
4055
by: Omer | last post by:
hi Everyone, I am using ASP.Net 2.0. When user logins, I check the credential and then made the cookie. My hoster's server is in Arizona region and I am in Pakistan. I set cookie's expiration time as 4 hours. It works perfectly fine on my PC and many other PCs which have correct time. But, if I set date to some old date, user is simply unable to login. This makes sense as probably cookie timing is not matching. Dilemma is that many users...
1
1181
by: chrisx | last post by:
I get java errors in IE with this cookie, any idea why? Also how do I name the cookie and set it to expire in 20 min. I am not that familiar with expiring cookies. Any help is appreciated. function setCookie(name, value, expires, path, domain, secure) { document.cookie= name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? ";...
3
3537
by: rh.krish | last post by:
I have a typical ASP.NET 2.0 Forms authentication application which authenticates against Active Directory. I use non-persistent cookie so that the user is NOT remembered across browser sessions. The timeout is set to 10 minutes. Here is the important code snippets that I took from my original code: string roleToCheck = .....; FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, member.UserName, DateTime.Now,...
0
10501
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10273
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10250
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7574
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.