Re: manual vs. meta refresh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Aug 13, 2007, at 2:16 PM, Richard Lynch wrote:

Of course, the question of whether it's a Good Idea to show something
different for a manual Refresh versus META refresh springs to mind...

I can't see why you'd want to do this for anything other than
educational purposes...


Well, as the OP, I can first tell you all that I don't actually need to do this anymore quite like this. Basically, what I was trying to accomplish was that I have an application that has access to sensitive student data (like grades and stuff), and I wanted to write it so that it would log you out and display a different screen after a specified period of time.... just in case the instructor walked away from their computer we didn't want it displaying whatever the instructor was last looking at forever.

So what I was doing was refreshing the page every 31 minutes and comparing with the last time the page was accessed (set via a session variable), and if longer than 30 minutes, it would log you out and show you a login form rather than the page you were looking at. The problem came in the fact that if you had 2 windows open simultaneously, the PHP couldn't tell if it was the background window or the front window doing the loading, so therefore it would never log you our.

The solution, which came to me from some of the early comments, was to create a new page that the META refresh sent to (logout.php) and then anytime you hit that page, it logs you out. So if the background or foreground window now refreshes and gets sent to that page.

Thanks everyone for their help on this.

--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada College
www.wnc.edu
775-445-3326

P.S. Please note that my e-mail and website address have changed from wncc.edu to wnc.edu.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux