Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internet Explorer 11 won't set cookies on a site

For some reason IE11 (only IE11, tested with other IE9 and IE10) won't create a session on a site i've been working on. So this means that a basic functionality such as site login won't work.

On other browsers this is working perfectly.

I researched a bit and found out that IE won't work with domains with underscore.. but my domain doesn't have one so what could be the problem? Thanks!

like image 762
prototype Avatar asked Mar 27 '14 14:03

prototype


People also ask

How do I fix cookies on Internet Explorer?

Internet ExplorerClick 'Tools' (the gear icon) in the browser toolbar. Choose Internet Options. Click the Privacy tab, and then, under Settings, move the slider to the top to block all cookies or to the bottom to allow all cookies, and then click OK.


2 Answers

IE 11 does not like a domain value in the cookie. Leave it empty.

Wrong for IE 11:

Set-Cookie: kohanasession=foobar; expires=Tue, 09-Apr-2016 01:01:01 GMT; path=/; domain=tc.mk; httponly 

Correct for IE 11:

Set-Cookie: kohanasession=foobar; expires=Tue, 09-Apr-2016 01:01:01 GMT; path=/; httponly 
like image 186
bebbo Avatar answered Oct 02 '22 10:10

bebbo


I know this is old, but hopefully this helps someone in the future. You cannot have a blank expires=; value in a cookie in IE11. You just have to leave the expires field out altogether.

like image 36
Gurnzbot Avatar answered Oct 02 '22 10:10

Gurnzbot