fix for losing private key while being logged in and accessing a public link
fix for undefined index
Merge pull request #3512 from owncloud/file_encryption_session_fix

fix for losing private key while being logged in and accessing a public link