Jump to content

Recommended Posts

Since I don't know the structure of your forum, I can't quite say. But the basic idea would be to have a column in your users and/or sessions table named $logged_in, and the only values would be 1 for true and 0 for false. Then, run a mysql_query on the table WHERE logged_in = 1.

Let's say you wanted to log a user out after 10 minutes. Create a new function named whatever you want, and a new column in the table named something like last_activity and set the type to timestamp. In the function, use strtotime to check when the user was last active, and if that was more than 10 minutes ago, unset the session for that user. Put the function in a file, and include/require that for every secure page.

 

You should also check out this tutorial on phpIT. I was the same as you just a few months back didnt have a clue. You might not be able to use this exact code from the tutorial but it will give you great insight to how such functions should work. Tutorial Here.

 

 

Hope its helpful.

Andy

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.