Window Object
What is it?
- Everything outside of the document, including:
- open, opener
- close
- scroll
- status
- focus/blur
- location (very cool code to get URL encoded data in book!)
- navigator
- appCodeName
- appName
- appVersion
- history
- forward()
- back()
- go()
- window.history.go(-1) is the same as window.history.back()
- Interacting between windows (or frames!)

Image from: JavaScript The Definitive Guide, 4th ed.
- Global Object
- -The window object serves as the global object and global execution context for client-side JS
- Following are essentially the same thing!
- var varName= "something"; - Instantiating a variable
- window.varName= "something"; - property of the window object
Build Window/Frame thingie...
Cookies
- What they are:
- Cookies are a small amount of named data
- stored by the web browser (client side)
- associated with a particular page (or server)
- accessed with the cookie property of the Document object
- What they aren't:
- Cookies in JS do not use any kind of cryptography and are totally insecure!
- A place to store indispensable data (limited space on client, limited life span)
- The 4 parts to a cookie (5 if you are picky...)
- name=value
- document.cookie="danCookie="+escape('hello world!')
- lifetime
- how long the cookie will persist
- with no expiration, cookie is deleted at end of session
- expires=date
- visibility
- Who can use the cookie
- path - can change what directories can use the cookie
- path='../'
- domain - can change the subdomain that can use the cookie
- domain='.rit.edu'
- security
- determines if http is fine - or if needs https
- (default is insecure)
- secure
Ex: Setting a Cookie...
- var nextyear=new Date();
nextyear.setFullYear(nextyear.getFullYear()+1);
document.cookie="danCookie="+escape('hello world!') +
"; expires=" + nextyear.toGMTString() +
"; path='/';
domain='polaris.it.rit.edu';
secure";
Build Cookie thingie...