Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Active topics - user last here
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

pwhitehurst
Starting Member

United Kingdom
18 Posts

Posted - 27 November 2008 :  18:46:55  Show Profile
Hi,

Can anyone tell me the rules for updating the last here information for a user?

It has been noticed on my forum that the active topics since last visit changes over the period of a users session. This is because the last date / time here information is being updated at some point. It seems to update when a user makes a post and also after a period of about 20 mins. It's causing mild frustration with forum users.

If anyone can let me know the rules and / or let me know which page(s) the code is located that makes the update to "Last here" that would be great.

I think I can solve this using session variables and cookies but I need to understand what it's doing at the moment and which bits of code / pages I need to look at. It maybe as simple as I've made a mistake in some of the mods I've applied which means the last here info updates when it shouldn't. Either way it'd be nice to know.


Thanks

Phil

<

Edited by - pwhitehurst on 27 November 2008 18:52:54

AnonJr
Moderator

United States
5768 Posts

Posted - 27 November 2008 :  19:21:51  Show Profile  Visit AnonJr's Homepage
With most servers, if you don't show any activity in a 20 min window the session is considered abandoned and any subsequent visits are considered a new session. This is a server thing.

The code checks to see if you are logged in and if you have an active session. If your session has expired, it updates the "last here" information when you start a new session by doing something again.

You can change the session length on the server, but its not recommended.<
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 28 November 2008 :  07:13:16  Show Profile  Visit HuwR's Homepage
the forum already uses session to do this, the 20 mins is probably the session timeout set on your server, it certainly shouldn't change during a users session, so you may indeed have a code issue with one of your mods.

you need to look for the UpdateLastHereDate function that is what deals with updating the date.<
Go to Top of Page

pwhitehurst
Starting Member

United Kingdom
18 Posts

Posted - 28 November 2008 :  20:05:56  Show Profile
Thanks Guys,

I've added another date time field to the members table to hold a pending last here date time. It will only update this value onto the last date here value once an hour has passed (and the seesion has timed out) since it was set. Once it's moved to the last date here value it then sets itself to the current date / time of the server etc. I've put the logic in ReadLastHereDate and UpdateLastHereDate

Keeps the active topics since last visit consistent for an hour for each member. If a member visits, leaves, and comes back within the hour then clearly the active topics will still be the same. but that's not a big issue.

Thanks once again.

Phil<

Edited by - pwhitehurst on 28 November 2008 20:07:45
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 29 November 2008 :  03:32:56  Show Profile  Visit HuwR's Homepage
wouldn't it be better to actually fix the code, since yours is obviously not functioning as it should be. I can stay on the forum all day without it resetting my lasthere time<
Go to Top of Page

pwhitehurst
Starting Member

United Kingdom
18 Posts

Posted - 29 November 2008 :  04:56:59  Show Profile
Huw

Well I scanned the entire site for where it updates the last here date and time (based on the function name you posted above) and it only does it when the session variable is empty

If IsEmpty(Session(strCookieURL & "last_here_date")) then
......


So the only conclusion I can come to is that the sever is timing out the session. (since I am not closing the browser) It then calls ReadLastHereDate and the end of this section in my original snitz code it called UpdateLastHereDate without any If conditions. Therefore next time the session timed out in another 20 mins the ReadLastHereDate wuodl return a date /time from only 20 mins ago, which is not what I want.

I've actually simplifed my solution using a dimensioned cookie but am I missing something here?

Cheers

Phil
<

Edited by - pwhitehurst on 29 November 2008 05:00:57
Go to Top of Page

pwhitehurst
Starting Member

United Kingdom
18 Posts

Posted - 29 November 2008 :  05:30:06  Show Profile
I presume when you stay on the server all day you don't have more than 20 mins between clicks etc. Which my members sometimes do if they are filling in a post at work and have to return to their day jobs before submitting the post. Hence the timeout.<
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 29 November 2008 :  06:10:25  Show Profile  Visit HuwR's Homepage
active.asp refreshes itself so your session should not time out. if your session timesout because you have a non active.asp page open then it will reset, but this is exactly how it is supposed to behave, session timeouts are how a server/website decides whether or not you still have the site open in your browser, if you want your session to last more than 20 minutes then change the session timeout..<
Go to Top of Page

pwhitehurst
Starting Member

United Kingdom
18 Posts

Posted - 29 November 2008 :  06:53:11  Show Profile
Hi,

It's timing out whilst they are taking their time filling in a reply to an active topic or making a new post.

I know the bit about active.asp refreshing itself but that is not a default you have to change the drop down box for that and if they click on an active topic and leave that page...

I'd found the bit on how to override the session timeout default probably about the same time you posted this. So I've changed the code to override the default session timeout to 40 mins now and told the members of the forum how it works. The service is hosted and I can't change the default on the server.

Thanks for your help on this.

Cheers

Phil<

Edited by - pwhitehurst on 29 November 2008 06:53:54
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 29 November 2008 :  09:03:31  Show Profile  Visit HuwR's Homepage
quote:
default session timeout to 40 mins
that's the best way
it shouldn't take 40 mins to make a post <
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.33 seconds. Powered By: Snitz Forums 2000 Version 3.4.07