Like many schools we have experienced the Javascript error for to many windows open cookie error. Datatel advises that you remove or modify the code to fix the issue. For us, we deemed that as a workaround, and weren't willing to make the change (partially because every upgrade until they fix the issue will require to redo the workaround. Instead, I decided to look into the actual issue, and for a way to fix it.
First I'm going to describe what their code does and why it can be problematic, and at times it feels difficult to locate the source of the error. Then I'll tell you how we solved it, and give some recommendations on how other schools can fix the issue.
The Javascript that produces the error message counts the number of cookies in the current session. They have decided that if you have more than 18 cookies in your session, it is to many and thus, you receive the error message. Web Advisor by itself produces 16 cookies upon the session being generated.
Their code only examines the number of cookies, it does not check to see if the cookie actually belongs to Web Advisor or not. The reason why this can be an issue is how different servers can read cookies via hierarchical methods.
For instance... Lets say your user first visits http://myschool.edu. Our Website for this URL generates 11 cookies. Then you eventually log onto Web Advisor at http://webadvisor.myschool.edu. Upon entering your credentials, Web Advisor generates 16 cookies. However, webadvisor.myschool.edu can actually read cookies generated at cwc.edu. See Table Below for more details...
Left Hand Column can read Top Row of URL Cookies... | mys.edu | wa.mys.edu | www.mys.edu |
| mys.edu | XXXXXXXX | No | No |
| wa.mys.edu | Yes | XXXXXXXXXXXXXXX | No |
| www.mys.edu | Yes | No | XXXXXXXXXXX |
- Based on the table above if you are on myschool.edu it cannot read cookies for any its subdomains.
- If you are at webadvisor.myschool.edu it can read cookies for its parent domain, but cannot view cookies for any siblings (such as www).
So our solution was to do the following. If somebody visits our website at the URL http://myschool.edu, we first clear any established cookies for myschool.edu. We then redirect the visitor to http://www.myschool.edu. As such, now when the user attempts to log into WebAdvisor they should not have the problem any longer.
Similarly... this problem can manifest itself if you have an independent URL for your Web Advisor installation. For instance myschoolWA.com If you allow access to the site via myschoolWA.com and then at some point that user is switched to www.myschoolWA.com then the user may experience the to many cookies error.
Ultimately this issue is not a Datatel or WebAdvisor problem in my opinion. I believe the problem lies within the browsers allowing a subdomain to access cookies of a parent website. While it certainly has its uses it can also lead to Cross site scripting issues if you aren't careful. (Think student website under the myschool.edu domain.)
Remember cookies are in the control ultimately of the user. So depending on the users settings, you may not be able to delete cookies even if you tell it to do so. But by trying to avoid the situation above this should greatly reduce the number of users that receive this error message at your school.
Have a Merry Christmas and Happy Holidays to everyone!
Cya
Paul