-3
I need help with a PHP user session script with waiting time, so that if there is no activity on the page it is redirected to an output page.
-3
I need help with a PHP user session script with waiting time, so that if there is no activity on the page it is redirected to an output page.
1
After the user has logged in, you can enter the following code snippet:
<?php
session_start();
session_cache_expire(1800); //o tempo é medido em segundos
?>
This way, every page that needs the user session, you should check if there is an active user session, thus:
<?
if(!isset($_SESSION)){
//aqui você aplica o redirecionamento
header("Location: ".$enderecoPagina);
}
?>
is automatic friend? in real time?
I’m a little confused about your "automatic", you mean that when you run out of time already redirect the page, or if the user tries to go to a page that needs a session and it has already run out, then you would have to redirect?
javascript
real-time
Browser other questions tagged php session redirect
You are not signed in. Login or sign up in order to post.
Welcome to Stackoverflow! Please explain the problem better, and if possible include a example of code that reproduces what is happening, because your question is not perceptible. See Help Center How to Ask.
– Filipe Moraes