Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I connect to a bunch of WiFi hot spots with my iPhone, and love that I have a VPN option.

One thing I don't love is that it disconnects from the VPN if the screen ever goes blank.

How can I keep the VPN connected so I don't have random emails or other data in the open for man-in-the-middle attacks?

share|improve this question

migrated from Aug 18 '11 at 15:57

This question came from our site for computer enthusiasts and power users.

The way IOS works, I don't think you can do this unless you disable the standby/auto lock timer. – wilhil Aug 18 '11 at 12:50
up vote 3 down vote accepted

According to this thread this is standard for most users. But there is Jailbreak solution with external app called Insomnia

Insomnia is an iPhone native application that, when enabled, will prevent the iPhone from sleeping, thus overriding its default behavior. This allows background applications to continue to run and WiFi to work long after the screen has been switched off.

(The iPhone's default behavior is to sleep 30 seconds after the screen has gone off, when not docked and charging that is).

Downside of this is your cpu etc is still running so battery will go down quickly.

There is also a tweak for Cisco VPN with SBSetting with Jailbreak that might work for non-Cisco software (as in the built-in VPN) but as I haven't tested it it's hard to say :-) It may be that the blog mentions the built-in VPN but I can't verify it myself. It's not clear whether it mentions Cisco app or the built-in VPN (and just names it Cisco VPN).

share|improve this answer
:( ok. I don't wanna jailbreak though, so I'm guessing no actual solution – Canadian Luke Aug 18 '11 at 19:57
Here is a code snippet to stop the idle timer. '[application setIdleTimerDisabled:YES];'. Try if it works. – Durai Amuthan.H Nov 5 '13 at 7:00
Tweak has since not been updated, and does not function. – iananananan Jan 10 '15 at 7:51

I have just signed up for VPN service this week and i have been having the same problem. I use it to go on Netflix and Pandora from out of the country. I have been playing around to see if i can get the VPN to stay connected. So far, I found a solution that has been working for about an hour or so now.

I have a jailbroken iPhone 4 and i have installed Backgrounder from the Cydia store, which keeps programs running even when closed or when the screen is off.

After installing this, I installed Pandora from the App Store and after launching it, I held down the Home button to background it.

So far, it seems to be working because Pandora uses my connection and if i keep it in the background, it will prevent the VPN from disconnecting.

I have only been using it for a couple of hours, so I'm not sure how good of a permanent solution it will be.

share|improve this answer
It would be great if you followed up with an edit to tell us whether this works well or not. – Dan Jul 26 '13 at 20:54

One workaround: on a jailbroken device, use Activator to link "Lock Device" or "Unlock Device" to "Toggle VPN". Everytime I unlock it, it reconnects to my VPN :) so now I am happy

share|improve this answer
This actually works pretty well. – iananananan Jan 9 '15 at 4:33
But will it stay connected while the screen is off? – Canadian Luke Jan 9 '15 at 15:16
@CanadianLuke Nope. It's a bummer. – iananananan Jan 10 '15 at 7:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.