Android & Wordpress Help center

Android: Enable local cookies in Phonegap webview

Have been creating Phonegap and Android hybrid app with mixed native and Phonegap specific UI components lately. Yesterday I came across a scenario where I was not able to get the cookie information. After hours of exploration found that a single missing line of code was all I needed to correctly retrieve my saved cookies. So here it goes:-

Inside your Activity which should extend CordovaActivity you should write:-


Just above the line:-


that is just before loading the webpage.

This will allow cookies to be accepted for file scheme URLs.

Hope it saves your time!

Single Post Navigation

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: