php-general Digest 10 Jul 2013 11:15:30 -0000 Issue 8290
Topics (messages 321584 through 321586):
Re: Making a Timeout Expiration Length to Session Variables
321584 by: Karim Geiger
Re: htaccess
321585 by: Tim Streater
syntax question
321586 by: Jim Giner
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
Can someone tell me what this syntax is? I looked around but don't see
any mention of it.
while(condition) : (statement);
--- End Message ---