path in javascript

L

Lisa

i'm new to javascript... could someone tell me how to set the path on this script...

<script language=javascript type="text/javascript">
<!--
function SetCookie(name, value, expires, path, domain)
{ document.cookie = name + "=" + escape(value) +
((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
((path == null) ? "" : "; path=" + path) +
((domain == null) ? "" : "; domain=" + domain);
}
var expiration = new Date();
expiration.setTime(expiration.getTime() + 60000);
SetCookie('name', 'Peter', expiration);
// -->
</script>

-Lisa.
 
H

Hywel Jenkins

wolverina_ said:
i'm new to javascript... could someone tell me how to set the path on this script...

What do you want it set to?

SetCookie('name', 'Peter', expiration);

SetCookie('name', 'Peter', expiration, "/path/of/directory/");
 

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,780
Messages
2,569,614
Members
45,289
Latest member
stfp04

Latest Threads

Top