views:

330

answers:

7

I have a web based email application that logs me out after 10 minutes of inactivity ("For security reasons"). I would like to write something that either a) imitates a keystroke b) pings an ip or c) some other option every 9 minutes so that I stay logged in. I am on my personal laptop in an office with a door, so I'm not too worried about needing to be logged out.

I have written a small python script to ping an ip and then sleep for 9 minutes, and this works dandy, but I would like something that I could include in my startup applications. I don't know if this means I need to compile something into an exe, or can I add this python script to startup apps?

+1  A: 

wrap the calling of your python app in a .bat file and put a shortcut to that .bat file in startup.

workmad3
+1  A: 

If you use firefox, just install the ReloadEvery extension.

André
the app only works in IE unfortunately. probably for the same reason i get logged out every 10 minutes.
contagious
@contagious Well maybe you can combine it with IE-Tab: https://addons.mozilla.org/de/firefox/addon/1419
André
+3  A: 

Assuming you use Windows, you can add a bat file containing the python run command in the Startup folder.

Example keeploggedin.bat

C:\Steve\Projects\Python> python pytest.py
pompo
+3  A: 

You can also use the Scheduled Tasks feature (on the Control Panel) to run it at startup, or you can change your script to ping the IP and exit, and scheduled it to run every 9 minutes. You have nice settings there, for example, you can stop running it at night, so you'll still log out.
You might still need the bat file though, I don't know about Python.

In fact, if you need just a simple ping you can scheduled ping.exe.

Kobi
+2  A: 

Pinging an IP will not likely keep your session from timing out. You will likely need to do an HTTP GET and include the session cookie supplied by the server to your browser when you login. Your script may be able to read the cookie from your browser's cookies folder after you have logged in via the browser.

Also, the web page may have javascript that calls the logout page when it times out. You may be able to use codemonkey to disable this behavior.

Chris Nava
A: 

i use the reloadEvery plugin for firefox to keep me logged into websites (forums, phpmyadmin, etc). simple yet effective.

Sean
A: 

I've been using this for a while, works great! http://stackoverflow.com/questions/969849/automatic-keystroke-to-stay-logged-in/971984#971984

cw22