Archive

Posts Tagged ‘Internet Explorer’

Cookies in Firefox and Internet Explorer

May 18, 2008 Josh 4 comments

Mmm…cookies…

Firefox and IE handle them differently. Go figure…

Firefox always shares cookies – across tabs and across windows. No matter how your windows or tabs come into existence, cookies are always shared in Firefox.

IE 7 sometimes shares cookies. It always shares cookies in new tabs. It always shares cookies with the new window if you choose File -> New Window from the menu (or use Ctrl+N). However, if you have an IE window open and you use the Start menu or double-click a desktop icon to open another instance of IE, it will not share cookies.

Seems really strange to me, as clicking File -> New Window appears to do the same thing as double-clicking the IE icon on my desktop. Both show up in the taskbar at the bottom of the screen. Both show up in the Task Manager under the Applications tab. But further investigation shows that only one shows up in the Processes tab of the Task Manager.

IE 7 spawns a new process when you open it from the Start menu or the desktop. However, it uses the same process if you open a new window from an existing IE process. This explains why cookies are shared when you use File -> New Window or Ctrl+N.

I ran into problems with this while working on a web application using Servlets & JSP. (If you’re looking for a great reference, check out Head First Servlets & JSP). Once I realized that a session means something different in IE than it does in Firefox, it all made sense, but I spent a lot of time learning this the hard way.

Can’t all browsers act the same?

Categories: Uncategorized Tags: ,