Persistent cookie overwrite session cookie

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In this code:

<!-- Begin code -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es-ES">
<head>
<title>cookie</title>
</head>
<body>
<script>
function setCookie(name, value, expires, path, domain, secure) {
document.cookie = name + "=" + escape(value) +
((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
((path == null) ? "" : "; path=" + path) +
((domain == null) ? "" : "; domain=" + domain) +
((secure == null) ? "" : "; secure");
}
</script>

<script>
setCookie( "svalores", "yyyyy", null, "/", ".mydomain.com", null );
</script>
End
</body>
</html>
<script>
var expiration = new Date();
expiration.setTime( expiration.getTime()+ (60000*60*24*2) );
setCookie( "svalores", "xxxxx", expiration, "/", ".mydomain.com", null );
</script>
<!-- End code -->

With internet options:
1.Block first-party cookies
2.Block third-party cookies
3.Always allow session cookies

If i use IE6 the cookie is created succesfully ("svalores=yyyy"), but if i
use IE7 the cookie is not created succesfully.

Is this correct?

Thanks.
 
(cross-post added to insetsdk.html_authoring)
Mario said:
In this code:

<!-- Begin code -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es-ES">
<head>
<title>cookie</title>
</head>
<body>
<script>
function setCookie(name, value, expires, path, domain, secure) {
document.cookie = name + "=" + escape(value) +
((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
((path == null) ? "" : "; path=" + path) +
((domain == null) ? "" : "; domain=" + domain) +
((secure == null) ? "" : "; secure");
}
</script>

<script>
setCookie( "svalores", "yyyyy", null, "/", ".mydomain.com", null );
</script>
End
</body>
</html>
<script>
var expiration = new Date();
expiration.setTime( expiration.getTime()+ (60000*60*24*2) );
setCookie( "svalores", "xxxxx", expiration, "/", ".mydomain.com", null );
</script>
<!-- End code -->

With internet options:
1.Block first-party cookies
2.Block third-party cookies
3.Always allow session cookies

If i use IE6 the cookie is created succesfully ("svalores=yyyy"), but if i
use IE7 the cookie is not created succesfully.

Is this correct?


Wrong newsgroup for an IE7 question. Should be
microsoft.public.internetexplorer.general
BTW web interface users may see that labeled
Internet Explorer General Discussions

However, I think you would probably have better luck
posting this question in a newsgroup mainly about web development.
E.g. go to MSDN Online's Newsgroups page and find one there.
The first one is called INETSDK HTML AUTHORING
I can try cross-posting there for you.
Depending on which portal you are using you may be able to
switch to that newsgroup by clicking on its link in this message's header.



Good luck

Robert Aldwinckle
---
 
Back
Top