Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-16-2007, 02:31 PM
Ronin Ronin is offline
Programming Professional
 
Join Date: Apr 2006
Posts: 299
Rep Power: 11
Ronin is on a distinguished road
Default PHP: Log Out Users

I use sessions to log in users. When the user logs in I update a table to 1 and once logged out it is set back to 0. The reason I did it this way was to avoid using cookies.

My problem is that when someone closes the browser it doesn't set that flag back to 0. They are still logged in. Any ideas on how to log these users out? Should I set an activity stamp and check against that?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 04-17-2007, 12:43 AM
v0id's Avatar   
v0id v0id is offline
Retired
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,635
Last Blog:
CherryPy(thon)
Rep Power: 28
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default

You can check for browser close-down, using JavaScript - but nowadays many people have JavaScript disabled, so it wouldn't work for everyone. IMO would the best solution be to make the timestamp, you was talking about. Then check it with a fixed amount of time, and if the user hasn't been active, you would set the flag to zero.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-26-2007, 10:07 AM
Saint Saint is offline
Learning Programmer
 
Join Date: Aug 2006
Posts: 63
Rep Power: 9
Saint is on a distinguished road
Default

I believe the time stamp would work. If they were not active for over 30 minutes or so then you could remove it. You could create a variable or time stamp in your DB. Everytime they move to a new page the time stamp gets reset so you can determine if they are active or not.
__________________
Hi >> Saint
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-26-2007, 10:42 AM
Ronin Ronin is offline
Programming Professional
 
Join Date: Apr 2006
Posts: 299
Rep Power: 11
Ronin is on a distinguished road
Default

That is basically what I did and it works fine for now.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP 4 end of life announcement Jordan Programming News 4 08-30-2007 10:55 AM
PHP Introduction clookid PHP Tutorials 10 01-16-2007 08:17 AM


All times are GMT -5. The time now is 04:52 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 98%

Ads