By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,606 Members | 2,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,606 IT Pros & Developers. It's quick & easy.

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

P: n/a
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?

Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Dan" <tr*****@gte.net> wrote in message
news:uZ**************@TK2MSFTNGP09.phx.gbl...
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?
Jul 19 '05 #2

P: n/a
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;
"changed" <ch*****@changed.com> wrote in message
news:bj**********@geraldo.cc.utexas.edu...
"Dan" <tr*****@gte.net> wrote in message
news:uZ**************@TK2MSFTNGP09.phx.gbl...
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?

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.