Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Websocket works in incognito Chrome but not in regular Chrome?

I wrote an app that uses websocket and I am running into a weird problem.

If I run my app in Chrome and try to reconnect, it cannot reconnect to the websocket.

However if I use incognito Chrome, it works every single time.

Is there a subtle difference between the websocket in Chrome vs incognito Chrome? Some sort of cache control maybe?

EDIT: I'm running Chrome 13. Sorry I can't provide any sample code as it reveals my app but the gist of the issue is that incognito Chrome can establish a connection to my server EVERY TIME, but regular Chrome succeeds once, then fails all subsequent attempts. Weird, right?

like image 431
kidcapital Avatar asked Aug 19 '11 03:08

kidcapital


People also ask

Why does a website only work in incognito mode?

Since you're seeing sites work in In Private but not in normal browsing, it's likely this is caused by an extension or a cookie/cache issue.

Do plug ins work in Incognito?

Extensions are not allowed to be enforced by the administrators in Incognito, whereas users can individually enable extensions in Incognito mode.

Why does GMail only work in incognito mode?

This isn't a security issue and sounds like a bug in the GMail website. You can very likely fix this issue by clearing your cookies for GMail. Try visiting chrome://settings/siteData?search=cookies and delete the cookies for mail.google.com and optionally Google.com. (Alternatively, hit F12 to open the Developer Tools.


1 Answers

Websockets make a usual HTTP query to initially connect to server. HTTP query also has cookies in the request. In my case, the cookies were huge, and incognito mode doesn't have it, only session_id, so cleaning the cookies in regular Chrome did the deal.

like image 167
Nikita Kapitonov Avatar answered Oct 03 '22 01:10

Nikita Kapitonov