Re: [PHP] Making a Timeout Expiration Length to Session Variables

2013-07-08 Thread Karim Geiger
Hi,

On 07/08/2013 05:10 AM, dealTek wrote:
 Hi all,
 
 I would like to make a timeout length to session variables, so that if a user 
 didn't use the browser page for let's say 5 minutes - the session variables 
 would expire and the user would need to login again.
 
 
 Q: What's the best way to implement this functionality?

You can either use cookies or do something like that:
http://stackoverflow.com/questions/3068744/php-session-timeout

In your case is would be
if ($_SESSION['timeout'] + 5 * 60  time()) {
// session timed out
} else {
// session ok
}

Karim

-- 
Karim Geiger
Auszubildender Fachinformatiker AE

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537



signature.asc
Description: OpenPGP digital signature


[PHP] Re: htaccess

2013-07-08 Thread Tim Streater
On 07 Jul 2013 at 21:22, Tedd Sperling t...@sperling.com wrote: 

 Confirmed. Those two lines cause the problem.

 However, commenting out those lines causes other problems.

 Are there similar statements to these:

   AddType application/x-httpd-php .php .htm .html

This one tells apache to recognise .php, .htm, and .html as suffixes of files 
that need to be sent to PHP. You probably don't want to remove that [1].

   AddHandler x-httpd-php5-cgi .php .htm .html

Dunno what this one does.

[1] But, having said that, realise that *all* files with those suffixes will be 
sent to PHP by apache, whether they contain any PHP code or not. Is that what 
you want? If I have an html file that contains some PHP code, I tend to use 
.phtml as suffix and so my AddType looks like:

 AddType application/x-httpd-php .php .phtml

--
Cheers  --  Tim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php