How to increase session timeout in silver light? - c#

I have been trying to increase session time out in silverlight from the default timeout time.
I am setting this time in webconfig. When I try to decrease the time it works fine and session gets expired in given time. But it seems that increasing the time has no effect at all. I dont think this issue is code specific. Any suggestions?

Did you configure both client and server side config files ? Both should be consistant, otherwise it works according to lower value.
Check for configurations on this site

I would check the application pool advanced settings in IIS. There is an Idle time out and Regular Time Interval (Recycling) setting.

Related

Unable to start the Kentico application when my computer restarts?

I installed Kentico 8.2 on my computer. But every time I turn off my computer and open it again. The Kentico Application never starts. I hope you can help me about my problem.
Your problem is not a Kentico issue at all, it's an IIS configuration issue. By default, IIS is configured to only run a website when it is first accessed manually or continually being used. If the website is idle and not running and you access it, the application pool kicks up and serves up the website. If there is idle time of 20 minutes (by default) it will go into a sleep state until it is requested again. When you restart your computer, IIS is in that sleep state until the website is first requested.
Within IIS you can set a few properties to help you out. In the Application Pool connected to your website go to the advanced properties of it. Check the General>Start Mode and ensure it is set to Always Running vs. On Demand.
Secondly, in the same Application Pool set the Process Model>Idle time-out (minutes) to something greater than the default 20 minutes. This will help only after the website is already running.
Thirdly, in the same Application Pool set the Process Model>Idle time-out action to Suspend. This will help the website start up faster when it does go to sleep.
Is autostart enabled in your IIS?
All above answers are valid, but if I remember correctly, there was also an issue with Skype taking up a specific port, if you set to "Run Skype on startup". This prevents some of the IIS services/websites to start. Not sure if that relates to your specific issue, but if you've got Skype installed and set to run on startup, try disabling this and restart your PC to see if it helped.

All Application Pools time out, but not one

I am debugging in Visual Studio 2010 with IIS 7.5. I have four enabled AppPools. This is on my development machine, so no one else accesses it, at all.
So the problem is that three of these AppPools time out, but forth one doesn't. I am not bothered why this one stays there, but more concerned why the other three time out, as I use them more often.
I have checked all settings for them and they match exactly. I can certainly increase "Idle Time-out" settings but wanted to know what is causing it.
Thanks for your help.
Disable pinging (set Ping Enabled to false). When it's turned on, IIS hosting proces checks constantly (every 30s) if a pool process is alive. If a given application pool process does not respond withing a predefined period (Ping Maximum Response Time = 90s) it is restarted. I can't tell exactly why one pool is not restarted - maybe while debugging it was responding to IIS pings.
I couldn't figure out the reason. But as a workaround, I set "Idle Time-out (minutes" property to 60 and it is working out for me.

How to maintain continuous Session in Dot Net application?

I am facing an issue in my application that whenever user search for any data and then keep the application idle for like 15-20 mins, and then try to perform any operation on the application, then the application crashes. I am using simple DevEx Grid to show data and ahve details rows and Popup control for that grid.
I think the issue is with the sessions as my application was unable to maintain the session for that duration and due to which application crashes.
Moreover, i have not used any session variables into my application for data.
I cannot find the real cause for this error.
Can somebody help me for the same.
You could write client side javascript to make ajax calls to the server.
This will keep your session alive.
It allows you to have a short timeout at the server, and still a long time out for idle users.
Be sure to have a timeout though, in case your user is away for a hour, the page should log him out.
You can just set the session timeout in IIS to a really high number or minutes (like 1440 for an entire day). This setting is in the "Session State" area.
Another option would be to use Opera as your browser, and load the page once. After that, use Opera's "reload page every..." option to automatically reload the page every minute. This would extend the session forever.
Since you don't store anything useful in session, you should make a way it could reload without crashing. For this you need to anylyse when the crash happens and find a way to prevent the crash. either by initializing with a sane default or catch the exception and start fresh.

User driven session expiration

I need to give my ASP.NET website users a way to control their session timeout.
I am using FormsAuthenticationTicket and cookies.
I want to give the users a way to specify how long the session will stay active. The range can vary between a few minutes to 1 day or even more.
I'm using idleTimeout (I asked a question here).
Also, I save the value entered by the user in the database and using that value I initialize the FormsAuthenticationTicket.
I have 2 more concerns: Application Pool and cookie. My website runs under a dedicated App Pool. Do I need to change the idleTimeout property for App Pool, too? Not programmatically, of course.
Anyway, to phrase my question: what other settings need to be done in order to have the session expiration dynamically set and working no matter what time interval?
Thanks.
EDIT: I am using IIS7 on a Windows Server 2008 machine.
it is never a good idea have a session time out too long as you will keep busy some resource on the server and if your web app is accessed by lots of different user it could affect the server performance.
Anyway you can just change the session time out programmatically using the below code
Session.TimeOut= [=nMinutes]
bear in mind that session timeout should be less than Application pool idle timeout, so if you increase session timeout, you have to increase application idle timeout too. Otherwise, application will get recycled. If application is recycled, sessions will expire automatically.
The minimum allowed value is 1 minute and the maximum is 1440 minutes.

Forms authentication and server time

I have a server that gets it time reset to 7 hours in the past. When this happens forms authentication no longer works.
When I resync the time with the server time it works again.
What could be causing this? It is actually and issue for me more so then changing the time, because I don't think it will be possible to keep all the clients and the servers in sync.
You can't have a production server with jumping time. Google "Windows NTP time synchronization" to find how to easily configure your servers to always be within microseconds of correct time.

Categories

Resources