This is a discussion on Page Exit / logout within the Coding Help forums, part of the Webmaster Help category; Hi guys I was wondering if any of you of a good way of logging a person out when they ...
| |||||||
| Register | Forum Rules | FAQ | Donate | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||||
| Hi guys I was wondering if any of you of a good way of logging a person out when they exit a page or after a period of inactivity. I have an ajax application and i need to know when people accidentally logout of it because when they login i change their status in a row in a mysql table but i need to know straight away when they log out to change the row again. Obviously there will be a log out button but i also need to know almost straight away if they leave the page, close the browser, are inactive for greater than X mins or for some reason the connection is dropped ie broadband goes down. I pretty sure i can whip some javascript type ajax thing for browser closing, page exits and inactivity but I'm not sure about a connection drop as its all client side scripting. I was wondering if anyone knew a sure fire way of doing all this already?? Any help please? |
| |||||
| Quote:
Niall. |
| |||||
| Sorry yea PHP I put in the tag's but forgot in the post. Logging someone out when they press logout is no problem, Its when they don't press it is the problem because they still need to be logged out straight away given any of the above scenarios. |
| |||||
| the session will destroy itsefl after 20 min. of innactivity. You can have a timer in java that checks the session and page the user is on and using ajax have the database updated automatically. Also using java you can check to see when they leave your website (domain) and open a new window which will do the update and display the "you log out" message.
__________________ :. Web Design & Development Web Design Ireland :. Search Engines Optimization Search Engines Optimization :. Directory Submission Directory Submission :. News & Press Release Ireland GiveItSocks.com :. Used Cars Ireland, Car Parts & Car Audio Cars For Sale, Car Parts & Accessories :. I Have 2 Find It Directory SEF Directory |
| |||||
| Sorry, should have read the question properly. You have a few options. One is to do as AIB do and have a meta tag in the which refreshes to the logout page after a certain period of inactivity. However this relies on the user keeping the page open. The other is do use sessions with a fairly short timeout. Each time the user does somethin ajaxy restart the timer. If they try to something when the session has timed out, redirect to the login page, which should also reset the field in your db to logged out. |
| |||||
| Quote:
But these are client based hmmm boss is worried about peoples BB going down and them not being logged out at all from the db. |
| Tags |
| exit, logout, page |
| Thread Tools | |
| Display Modes | |
|
|
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Successful Site in 12 Months with Google Alone | montyauto | Webmaster Articles | 11 | 18-02-2008 01:28 PM |
| B2C and B2B on the same page | Peter McC | Webmaster Discussion | 5 | 30-01-2007 01:19 PM |
| Web Development Quote | ButtermilkJack | Marketplace Requests | 5 | 24-01-2007 11:04 AM |
| Page titles | anthonymcg | Webmaster Discussion | 9 | 27-11-2006 03:54 PM |
| SEO and Images on your default page | sinead | Search Engine Optimisation | 6 | 05-08-2006 09:33 PM |
| ||||||||
| | ![]() | |||||||