Session Timeout not working on classic ASP - session

I am working on classic Asp application. I am trying to set the session timeout as 5 minutes. But it's not working. I tried with following solutions but no luck.
Tried by setting the session.timeout = 5in web.config.
Tried by setting the session.timeout = 5 in global.asa file in both Application and Session event.
Set the session.timeout property of ASP in IIS.
Set the idle timeout of application pool of the web page.
I am using IIS8.5 and server 2012 OS.
Anyone help me to solve this issue?

Have you try to put session.timeout in very top of your pages, before all script tag? Can you show your web.config and global.asa? If success you need to put session.timeout in all pages

Related

cakephp session timeout not working

I have cakephp site, I was having problem that was after being idle for about >= 1 hour it gets log-out automatically
so I googled to extend timeout for that I wrote the following in core.php
Configure::write('Session', array(
'defaults' => 'php',
'timeout' => 28800, // 8 hours.
)
);
I want to keep a logged in user logged-in even after being idle for less than 8hours
but this is not working
how can I sort out this?
According to CakePHP manual, the unit of Session.timeout option is "minute", so 8 hours should be 60*8=480
Regarding the setting not work, I think maybe you could try to clean the cakePHP cache files / restart web server or change the debug level to 2 for troubleshooting?
CakePHP 2.0 manual sessions
May be you are using CakePHP 3, that is why you are facing this issue. Session timeout does not work in CakePHP 3, You might use cookie_lifetime, please check https://github.com/cakephp/cakephp/issues/5664
I had the same problem in CakePHP 1.3
The problem was that CakePHP was using the settings defined in php.ini instead of the one I was defining in core.php
So I had to change in core.php:
Configure::write('Session.save', 'php');
to
Configure::write('Session.save', 'cake');
And it worked like a charm!

Changing session timeout for ASP.NET MVC 4 app

My app is configured to run through IIS. I'm trying to change the session timeout from the default 20 minutes to 1 minute.
I've tried the following, with no success:
Changed the Idle Time-out (minutes) property in the App Pool (figure 1)
Changed the Time-out property in the ASP page of the App configuration in IIS (figure 2)
Added <sessionState mode="InProc" timeout="1"/> under <configuration><system.web>
Any ideas or suggestions would be greatly appreciated.
Thanks.

Drupal 7 on browser close automatic logout

I'm using Drupal 7.
drupal?q=user
when we logged in , after that we close browser & reopen browser again then it should ask for login.
But it remains logged in
I have used session expire module & also set
ini_set('session.cookie_lifetime', 0); in sites/default/settings.php
but it didn't work anyone have solve?
You should set this in your settings.php
ini_set('session.gc_maxlifetime', 0);
ini_set('session.cookie_lifetime', 0);
But in FireFox session_cookies keep alive till the browser compeletly closed,(not terminate by closing only drupal tabs ) :(
Session Expire module create a instance on a table called session, that's why if you change session cookie on setting.php nothing happen... the only way to resolve it is creating an ajax that call the user/logout page on browser clousure.
I am trying to get this working without success, if you got finally the solution can you share with me, please!
see this link to get more information: http://eureka.ykyuen.info/2011/02/22/jquery-javascript-capture-the-browser-or-tab-closed-event/

IIS 7.5 not taking notice of customErrors for 404 returned by MVC 3 app

I'm running my MVC 3 app (recently updated from 2) on IIS 7.5 (Win 7 64bit) with a .NET 4.0 integrated pipeline app pool and have the following set-up in web.config:
<customErrors mode="On" defaultRedirect="~/Problem/Oops" redirectMode="ResponseRedirect">
<error statusCode="404" redirect="~/Problem/NotFound" />
</customErrors>
If an action method on a controller throws an exception the server and hence generates a 500 errorcode it correctly sends the browser to the default redirect URL.
However if my action deliberately returns a HttpNotFoundResult via HttpNotFound() I get the IIS 7.5 404.0 error page and not the one indicated in my web.config.
If I enter a URL that doesn't exist on my app like http://localhost/MyApp/FOO then I do get shown the page as indicated by the web.config.
Anybody have any ideas why I'm not getting redirected to my custom 404 error page when using HttpNotFound()?
Please try below syntax instead of calling HttpNotFound and let me know the result ;)
throw new HttpException(404, "NotFound");
Have you tried setting Response.TrySkipIisCustomErrors = true;?
(see http://blog.janjonas.net/2011-04-13/asp_net-prevent-iis_75_overriding-custom-error-page-iis-default-error-page)

Need help with Global.asax file

I have problem with default.aspx setting in global.asax file.When i am running dot net application from solution explorer i can set the default page as start page or when i am running the application the on IIS server i can set that default page as start page through the setting.This thing i want to do in programmatic way using the global.asax file and session start method.Without doing any setting whenever i will run the application the default.aspx page should come first.This has to work in programmatic way not using any setting.Hope i explained my problem.
Thanks,
Masum
I don't think if there is a programmatical way to set startup page. You can set a redirection to Session_Start but what if user comes from another website that linked your page product.aspx?category=hardware. Do you want him to redirected to default.aspx ?
I thing the clear way is that, remove these files from your application :
index.htm, index.html
default.htm, default.html
index.aspx
then default.aspx will be the only option to redirect.
hope this helps.
Have you tried putting
void Session_Start(object sender, EventArgs e)
{
Response.Redirect("default.aspx");
}
in the Global.asax file?
You could set a small session variable in the default.aspx page , i.e.
Session("AppInit") = True
and then on every other page_load event do something like this:
If Session("AppInit") <> True then
Response.Redirect("Default.aspx")
End If
You could write a HTTP Module to redirect all traffic going to the default URL to a particular page.
Easy to do and you can set it programatically.
Here are some pages:
http://support.microsoft.com/kb/307996
Link
http://www.15seconds.com/Issue/020417.htm

Resources