9

I can see how to put stuff in Session and Cache from this project.

Can you please tell me how to detect the session timeout in controllers/actions? Do we need some kind of attribute for it?

3
  • Yes, Create an attribute and keep it as attribute for the controller/action and in the attribute class check session value and if not valid redirect to login page Commented Feb 24, 2015 at 6:31
  • I don't want to check my own objects in the session whether they exist or not. I need a global strategy to see if old session is expired? Commented Feb 24, 2015 at 11:44
  • Session expiration is only tracked via its IDistributedCache entry expiration, which has no notification mechanic. What are you trying to do when the session expires? Commented May 28, 2015 at 16:52

1 Answer 1

2

If I were you I would try to use MVC6 cache tag helper.

Here you can read more http://www.davepaquette.com/archive/2015/06/03/mvc-6-cache-tag-helper.aspx

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.