Click here to Skip to main content
14,640,654 members
Rate this:
Please Sign up or sign in to vote.
Hello everyone,

I have developed a questionare application via MCC3 design pattern.

User logins via form. Then I keep it's infos in a session. But it ends very quickly (approximately 10 minutes. ) There are over 100 questiones so time is not enough. Is there any way to increase that?

Things that I tried.

edited web config.

    <sessionState mode="InProc" timeout="30" />

edited app config.

(write one more method to manage sessin state and timeout)

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

You should not extend the session - each user instance increases the memory usage on teh server, which can't be disposed of until the session ends. See MSDN:[^]
And bear in mind that each time the client communicates with the server, it resets the Session timeout - so if you are running out, it's because there is nothing happening as far as the server can tell!

If you are having problems with client session expiry, then I'd strongly suggest that you use Cookies instead - and let the session die a natural death.
FoxRoot 10-Apr-15 4:31am
How much time does a cookie have to expire? I can't manage session. There is no problem on local server, but I think there is a problem on IIS.
OriginalGriff 10-Apr-15 4:42am
Up to you - by default it's when the user closes the browser, but it can be sooner or later if you set the expiry date and time.
FoxRoot 10-Apr-15 6:27am
Thanks for the reply. I have 2 question.

I am using HttpContext.Current.Session["kullanici"] = kontrol; this line of code to set session. How about cookies? There is a problem with 'Response'.

And secondly how can i set cookie time?
OriginalGriff 10-Apr-15 6:40am
All in the documentation:
FoxRoot 13-Apr-15 1:06am
Thanks for the reply. Now It works :)
OriginalGriff 13-Apr-15 4:25am
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100