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
https://forums.phpfreaks.com/topic/59754-solved-session/#findComment-297008
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
https://forums.phpfreaks.com/topic/59754-solved-session/#findComment-297009
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
https://forums.phpfreaks.com/topic/59754-solved-session/#findComment-297013
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
https://forums.phpfreaks.com/topic/59754-solved-session/#findComment-297025
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.