Update Application.java

made some changes to do some session handling