Forum Moderators: coopster

Message Too Old, No Replies

working with sessions

         

kkonline

10:47 am on Sep 23, 2007 (gmt 0)

10+ Year Member



1> I want to have a time limit for the sessions ... means if the user is online then his session should expire if he's logged in and INACTIVE for 5 mins say.

Is it possible if the user is active or inactive after he logs.

2> I want to count the total time the user is actively online till date. (counts the number of seconds he's online ever since he registered)

How to do the above tasks...

Is there any standard code or class which can be used for authenticating and registering users because it's very common for any site

Habtom

10:58 am on Sep 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



means if the user is online then his session should expire if he's logged in and INACTIVE for 5 mins say.

It seems you should look more into cookies [php.net]

kkonline

11:03 am on Sep 23, 2007 (gmt 0)

10+ Year Member



Hab what about the second question .. to count number of seconds the user was ever actively online on the site?

Any standard code or class that can be used for authenticating and registering users because this is a very common thing with all websites

jatar_k

1:15 pm on Sep 23, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



this thread covers sessions and logging in and talks about timing out users

[webmasterworld.com...]

A count of how long they have been online would never be acurate, you can only include the time between page accesses. It would also be a ton of db writes, one per page per user.

henry0

1:44 pm on Sep 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you are looking for "registered" users then it could be measured (I suppose)
Example: look for scripts like "Who's on line"
log a time when ON and Off.

Although it could get complicated if you have set "Remember me" when login in.