Cookie does not expire for some users on one server

H

HorseGeek

I have three servers: Server1, Server2, and Server3.

There is a login cookie does not expire for SOME users on Server2.
Ironically, the login cookie expires correctly for ALL users on the
Server1 and Server3 machines.

This seems to imply a problem with the user's browser settings ...
except the users that have consistent problems with the Server2 are
able to read the logon cookie and other cookies which control
navigation to the Server2 website.

The code is identical on Server1 and Server2 ... so there should be no
problems caused by coding differences.

The individuals that have problems on the Server2 do NOT have any
problems with the cookie expiring on the other two servers.

One of the users having problems has had two machines. One Windows
2000 Professional and a new Windows XP machine. The problem contiues
even with the new machine and new operating system.

The webservers are all IIS 4.0
The operating systems on all the servers is Windows NT
The time matches on all the servers.

Unfortunately, I can't duplicate the problem. The cookie expires
IMMEDIATELY for me on all three of the servers.

If anyone can point me to a solution I would greatly appreciate it.

The same users will leave the Server2 website and have their login
cookies not expire on the Server2 website.

The code called is:
function DeleteCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1000);
var cval = GetCookie(name);

var path_variable = document.URLUnencoded;
path_variable = new String( path_variable);
var path_start = path_variable.indexOf("//");
var cookie_path = path_variable.substr(path_start + 1);
var path_end = cookie_path.lastIndexOf("/");
cookie_path = cookie_path.substr(1, path_end);
path_start = cookie_path.indexOf("/");
var path_len = path_end - path_start;
cookie_path = cookie_path.substr(path_start, path_len - 1);

if (path_len > 0) {
document.cookie = name + "=" + cval + ";path=" + cookie_path +
";expires=" + exp.toGMTString();
}
else {
document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
}
}
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top