WARNING! You can only run this test off of a "real" webserver (i.e. over http); you can't run this test directly off of the file system.

Also note that the paths used in this test don't have to actually exist; we can get 404 errors on every one of these pages but still successfully test the cookie functionality.

Test Cookie
storeEval parseUrl(canonicalize(absolutify("html", selenium.browserbot.baseUrl))).pathname; base
echo ${base}  
open ${base}/path1/cookie1.html  
deleteAllVisibleCookies
assertCookie  
open ${base}/path2/cookie2.html  
deleteAllVisibleCookies
assertCookie  
open ${base}/path1/cookie1.html  
createCookie addedCookieForPath1=new value1  
createCookie addedCookieForPath2=new value2 path=${base}/path2/, max_age=60
open ${base}/path1/cookie1.html  
verifyCookie regex:addedCookieForPath1=new value1  
assertCookiePresent addedCookieForPath1
verifyCookieByName addedCookieForPath1 new value1
verifyCookieNotPresent testCookie  
verifyCookieNotPresent addedCookieForPath2  
deleteCookie addedCookieForPath1 ${base}/path1/
verifyCookie  
open ${base}/path2/cookie2.html  
verifyCookieByName addedCookieForPath2 new value2
verifyCookieNotPresent addedCookieForPath1  
deleteCookie addedCookieForPath2 ${base}/path2/
verifyCookie  
Testing creating cookies with same name but diffrent paths
createCookie testCookieWithSameName=new value1 path=/
createCookie testCookieWithSameName=new value2 path=${base}/path2/
open ${base}/path1/cookie1.html  
verifyCookieByName testCookieWithSameName new value1
open ${base}/path2/cookie2.html  
verifyCookie regex:testCookieWithSameName=new value1  
verifyCookie regex:testCookieWithSameName=new value2  
deleteCookie testCookieWithSameName ${base}/path2/
open ${base}/path2/cookie2.html  
verifyCookieByName testCookieWithSameName new value1
verifyNotCookie regex:testCookieWithSameName=new value2