Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

admin timeout


newtech

Recommended Posts

Where can I change the admin timeout? Is there a way to make it so that as long as I have the admin window open, it does not require logging in again until the browser is closed?

Link to comment
Share on other sites

Somebody has had to figure out a way to make it so that you are not logged out of admin so quickly.

Where can I change the admin timeout? Is there a way to make it so that as long as I have the admin window open, it does not require logging in again until the browser is closed?
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
Still have not received an answer on this

 

Backup your files at first.

Follow me step by step:

I:create a php file named "null.php",and put contents below into it:

<?php
/*
* File Name		  : null.php
* Last Modified Date : 2007/12/11
* Author			 : www.bodait.com
* 
* Description		: just for session start
* 
*/
require('includes/application_top.php');

require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

II. upload this file to store root/admin/

 

III.Add codes below into store root/admin/includes/header.php, you can put these codes to the end of header.php:

<script language="javascript">
function ajax_send_request(url) 
{
	http_request = false;

	if(window.XMLHttpRequest) 
	{ 
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) 
		{
			http_request.overrideMimeType("text/xml");
		}
	}
	else if (window.ActiveXObject) 
	{
		try 
		{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) 
		{
			try 
			{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) 
	{ 
		return false;
	}

	http_request.onreadystatechange = ajax_process_Request;

	http_request.open("GET", url, true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
	http_request.setRequestHeader('If-Modified-Since','Sun,3 Jun 1973 00:00:00 GMT');
	http_request.send(null);
}

function ajax_process_Request() 
{
	if (http_request.readyState == 4) 
	{ 
		if (http_request.status == 200) 
		{ 
		  //alert(http_request.responseText);
		  return true;
		} else 
		{ 
		  return false;
		}
	}
}
setInterval("ajax_send_request('./null.php')", 5*1000);
</script>

 

IV: Done! And admin won't auto logout until the window to be cloesd.

Everyone is changing the world.

Everyone is a world.

For everyone needs my help, PM or email if I amn't online.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...