Jump to content

[SOLVED] session


bhavin12300

Recommended Posts

I don't think you can tell which sessions are active or not, at least not with PHP. Here is how I would go about it.

 

  • Make a column in the users table called "last_active".
  • Every time the user clicks, update that column in the table to the current time with a timestamp.
  • On the page where you are showing the users online, just select all the users from the database where the last_active field is X minutes old, which will select the users that have currently been active.

Link to comment
Share on other sites

i havent done something like that but if im going to do that then i will do this

 

when the user log get the information od him and set on the table like active then he leaves set in active

how ?

when the user logged update the table in your db for that person set as active then before he logout or once he logged out set your table field like in active

Link to comment
Share on other sites

i havent done something like that but if im going to do that then i will do this

 

when the user log get the information od him and set on the table like active then he leaves set in active

how ?

when the user logged update the table in your db for that person set as active then before he logout or once he logged out set your table field like in active

 

You can't rely on the user to press "logout" all the time, so your method would be unreliable.

Link to comment
Share on other sites

i havent done something like that but if im going to do that then i will do this

 

when the user log get the information od him and set on the table like active then he leaves set in active

how ?

when the user logged update the table in your db for that person set as active then before he logout or once he logged out set your table field like in active

 

You can't rely on the user to press "logout" all the time, so your method would be unreliable.

 

yes i know dude i only giving here an idea if  i were to do that ill do an option on my code like before he leave ill put a pop up screen like sure you want to logout

look some of the members here aren't knowledgeable enough so giving then all of this stuff

will make there nose bleed  ;D

Link to comment
Share on other sites

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.