Click to See Complete Forum and Search --> : how long is the session AND database's
pnj
Feb 26th, 2001, 06:00 PM
I know you can set the session variable time(default is 20 minutes) but I want to know how long my user is connect.
so if they come onto a page and leave after 5 minutes I want to write this to my database.
any suggestions?
thanks
JoshT
Feb 27th, 2001, 06:50 AM
Interesting, I was thinking about this the other day.
You would have to create session variables to store the start time and the end time. You'd set the start time on the session start event. Then everytime they access one of your pages you would set the end time. Then when the session ends or times out, you'd get the difference in the times and add that to the db. It wouldn't be 100% accurate but it would give you a good idea.
Also, I think you could mine the web servers logs for the same IP address and browser-specific HTTP headers to see the time period of someone's HTTP requests.
Josh
pnj
Feb 27th, 2001, 12:31 PM
You can also use session_onstart and session_onend in the global.asa
then do some simple math on the two numbers, but I think I read somewhere that
the session_onend isn't always accurate.
right now I am writing to a database the users IP, connection speed, browser,and the time they hit the server.
what i want to do is find out how long they stay on the page. so a function has to run on session_end.
this is the only way I can think of right now.........
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.