JScript: Can't Programmatically Delete Cookies on Windows 2000 Professional

D

Dan

I persist the login info using cookies so that a user doesn't have to login
every time they come to our website, unless they previously logged out.
Everything works OK on W98 SE, and Windows XP Pro machines.

On a W2K machine, IE6.0.2800.1106 SP1, the following function won't delete
cookies, or deletes them but they're mysterioulsy re-created when the web
page is subsequently referenced. Therefore, a web user can't logout.

// ============================================
// remove login cookies
// ============================================
function KillLoginCookies ( )
{
Response.Cookies ( sCookieCustomerID ) = '';
Response.Cookies ( sCookieCustomerID ).Expires = '01/01/1980';
Response.Cookies ( sCookiePassword ) = '';
Response.Cookies ( sCookiePassword ).Expires = '01/01/1980';
}

What am I missing here?
 
C

changed

Dan said:
I persist the login info using cookies so that a user doesn't have to login
every time they come to our website, unless they previously logged out.
Everything works OK on W98 SE, and Windows XP Pro machines.

On a W2K machine, IE6.0.2800.1106 SP1, the following function won't delete
cookies, or deletes them but they're mysterioulsy re-created when the web
page is subsequently referenced. Therefore, a web user can't logout.

// ============================================
// remove login cookies
// ============================================
function KillLoginCookies ( )
{
Response.Cookies ( sCookieCustomerID ) = '';
Response.Cookies ( sCookieCustomerID ).Expires = '01/01/1980';
Response.Cookies ( sCookiePassword ) = '';
Response.Cookies ( sCookiePassword ).Expires = '01/01/1980';
}

What am I missing here?

What is the code being used to create the cookies?
 
D

Dan

The cookies are created as follows:

Response.Cookies ( sCookieCustomerID ) = sLoginID;
Response.Cookies ( sCookiePassword ) = sPassword;

// get a date 1 year in the future
var d = new Date;
var sDate = d.getDate ( ) + '/' + (d.getMonth ( ) + 1) + '/' +
(d.getFullYear ( ) + 1);

Response.Cookies ( sCookieCustomerID ).Expires = sDate;
Response.Cookies ( sCookiePassword ).Expires = sDate;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top