I would like to know if there is a way to preserve BlueTooth connection details in a mod_python session variable (under MWS).
My plan is to use javascript for calling periodically via AJAX a python script for collecting GPS data. However, every time this is done the select BT source menu shows up. I would like to have this shown only first time and then to feed connection details from a session variable rather than from user input - bt_discover().

I have tried
address, services = socket.bt_discover()
session['target'] = (address, services.values()[0])

but at second reload of page the session['target'] does not exist. Session is working with other variables - I have tested it with simple strings. For example str(target) is also preserved , but becomes unusable for socket connection.

Another solution for this purpose would be to use a python timer instead of javascript calls. However I did not find any reference on how to include a timer under mod_python.

Any hint would be greatly appreciated - python was not my first choice for programming, but I see many advantages in using it.

all the best,