Re: how to automatically logout users from my site



On Jan 19, 11:03 pm, camili...@xxxxxxxxx wrote:
hello.
I'm building a site using php I have a setup.php page wich has at the
begining session_start();
and every single page from my site includes setup.php. When a user
registers I save in $_SESSION["Login"] the userName, so that when !
isset($_SESSION["Login"]) I can redirect him to the login.php page.
After some inactivityperiod, e.g. 20 min, I need that user to be
automatically logged off. Besides I need to keep track of the users
that are online in that moment, so the logout should run some server-
side script too. Can anyone give me some ideas??

You could save the username as a cookie and set a expiry time e.g
setcookie("username", "user", "/", "EXPIRY TIME");

Then for each page they load do a setcookie to keep it refreshed with
the timelimit.
.



Relevant Pages

  • how to automatically logout users from my site
    ... I'm building a site using php I have a setup.php page wich has at the ... begining session_start; ... side script too. ...
    (comp.lang.php)
  • SP2 SP2 SP2
    ... >I changed my automatic update to take place at 12:00 ... >is the begining of the day so how come i didnt get it ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: parallel execution
    ... Thank you Mike. ... Start manually a PHP program named flip.php wich will do something, ... cron in a batch file from a host, because I can't put it on a host ...
    (comp.lang.php)
  • Re: Security isseu
    ... My website is built in HTML and PHP. ... there is a menu wich ... redirect to the main page. ...
    (alt.html)
  • expor java variables to php
    ... I have several java-programs, and I wich to write a class that can export ... some variables to php using the method "post". ...
    (comp.lang.java.programmer)