How to make difference between first time login and logout after 20 min session


I am trying make changes in my application when application is idle for 20 min, user should be redirected to logout web page, but problem I am facing is for first time login also user session is null and after 20 min idle also session becomes null, I have no condition to make difference between both.

Page simply get refreshed to home page like it happens in first time login. Login is done by SSO authentication using IDP. 

Hi @Richa Thapa
Can you please elaborate, I didn't get 2nd line you mentioned.


Hi Sriyansh Thanks for reply. To elaborate my second line, after application is idle for 20 min and end user try to access the application it redirects to home page since session username becomes null. I am trying to make it redirect to logout page. But issue is when user logs in first time username is null and redirects to homepage. I am not able to make difference for both flow as in both condition username is null. Timeout is fine, it should be 20 min only default set on machine.config. Issue is for page redirecting.
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.