Add special session handling for selectedModel

Add special session handling for selectedModel to avoid leaks through
session
Remove spaces at end of line in application.ini
Fix session handling if selectedModel is empty
Add special session handling for selectedResource

Add special session handling for selectedResource to avoid leaks through session