Hello, I'm new to these forums. I have posted this question to the PyQT mailing list several weeks ago, but got no response whatsoever, so I thought I'd try here.

I have a web browser application written in PyQt4 which uses a subclassed QWebView. If I load a URL that is password protected, or uses a web session (such as php session) for security, and then subsequently click a link that opens a new window (e.g. target="_blank" or javascript window.open()), the new window opens without authentication or session data and a 403 error results.

The following code illustrates this problem by opening a password-protected page on my website where you can click a link with "target=_blank" set.

Qt Code:
  1. from PyQt4.QtCore import *
  2. from PyQt4.QtGui import *
  3. from PyQt4.QtWebKit import *
  4. import sys
  5.  
  6. class mybrowser(QWebView):
  7.  
  8. def __init__(self, parent=None):
  9. super(mybrowser, self).__init__(parent)
  10. url = QUrl ("http://www.alandmoore.com/wwwtest")
  11. url.setUserName("test")
  12. url.setPassword("test123")
  13. self.load(url)
  14.  
  15. def createWindow(self, type):
  16. self.w = mybrowser()
  17. self.w.show()
  18. return self.w
  19.  
  20. if __name__ == '__main__':
  21. app = QApplication(sys.argv)
  22. w = mybrowser()
  23. w.show()
  24. app.exec_()
To copy to clipboard, switch view to plain text mode 

How can I get new windows to retain the security credentials of the parent window?