Author |
Topic |
nickw
Junior Member
Ireland
193 Posts |
Posted - 01 June 2003 : 16:15:45
|
Hi Jan,
No, not the timeout, for sure....
This has happened since the day I implemented it. Very weird, I know... |
Nick |
|
|
masterao
Senior Member
Sweden
1678 Posts |
Posted - 01 June 2003 : 17:47:52
|
I know a method which allows you to test this yourself. You need two different member-accounts and two different web-browsers. Sign on as "member1" in one browser, and go to any page in your forum. Then sign on as "member2" in the second browser. First check the active users statistics on default.asp, and then on the active users page. This allows you to re-create the login sequence and see if it removes all users or not.
Do this occur if you remove the reqire login to view forum?
If you could provide a link to a text-version of your inc_header.asp as well, I will take a look at it.
|
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
Edited by - masterao on 01 June 2003 17:48:49 |
|
|
nickw
Junior Member
Ireland
193 Posts |
Posted - 02 June 2003 : 07:51:51
|
Hi Jan,
The funny thing is, that works, and users do show up some of the time. It seems to happen intermitantly.
Here is the inc_header file... http://www.ifsd.ie/inc_header.txt
You can login to the forum using the username snitz, password snitz.
Thanks again!
|
Nick |
|
|
masterao
Senior Member
Sweden
1678 Posts |
Posted - 02 June 2003 : 08:34:55
|
I think I know why some logins removes all members/guests from time to time.
Im not completely sure, but I believe that the problem occurs because of firewalls/security programs. When a member logins, the sub AUHandleLoging() deletes the member's guest status based upon an ip-address. If that ip-address is empty, it will delete all visitors (guests and members) who doesn't have an ip-address.
As I mentioned, Im not completely sure about this, but Im gonna see if I can recreate the problem on my test-forum.
Im at work now, so Im not able to do much more at the moment. I looked through your inc_header.asp, and it appeared to be ok. |
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
Edited by - masterao on 02 June 2003 08:38:00 |
|
|
nickw
Junior Member
Ireland
193 Posts |
Posted - 02 June 2003 : 10:57:08
|
Ahhh! That would explain a lot!
My site is running behind ISA Server, so everyone would be shown as my servers IP address.
It would be nice to see if that could be "got around" if someone has that type of setup..
I look forward to hearing from you.
Cheers,
|
Nick |
|
|
masterao
Senior Member
Sweden
1678 Posts |
Posted - 02 June 2003 : 14:01:02
|
So everyone who logs in on your forum are given the same ip-address?
I did a few tests on my test-server, but Im not able to recreate the problem.
I've also been thinking on how to circumvent this problem codewise, and I can only think of either adding a cookie-variable or a session variable which keeps track of each user, and which is used by the active users code to update the database (which would replace the ip-string).
|
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
|
|
nickw
Junior Member
Ireland
193 Posts |
Posted - 02 June 2003 : 14:39:35
|
Yep,
You see, everyone is seen as 10.10.10.1 which is my servers IP Address... That is the correct way for the firewall with a proper proxy to work.
So, the cookie idea sounds great! (I had to do the same for my Webtrends software).
Thanks for realising the issue! |
Nick |
Edited by - nickw on 02 June 2003 16:08:53 |
|
|
nickw
Junior Member
Ireland
193 Posts |
Posted - 02 June 2003 : 14:42:06
|
Actually, I think some other variable would be better... A lot of people block cookies nowadays... But hey, I don't really mind either way
|
Nick |
|
|
masterao
Senior Member
Sweden
1678 Posts |
Posted - 02 June 2003 : 15:50:59
|
Im glad to have been of some help, even though it wasn't that much.
The other option would be a session variable, which could be resource taxing if you have a lot of concurrent visitors. Atleast you get to choose from two options.
BTW, you could post your solution here, in order to help others who has a similar server setup. |
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
|
|
nickw
Junior Member
Ireland
193 Posts |
Posted - 02 June 2003 : 15:57:08
|
Sorry Jan,
Confused.... I cannot solve this problem without someone changing the ActiveUsers Code.... I have no idea how to do this I would have, at the most 20 Active users at a time... So, how can it be done?
I can't modify my server setup (publish the server as opposed to the site) as it would really open my servers to attack.
The session variable sounds to me to be the best option, even for sites that have 100 - 200 online at a time..
Also, I am running on SQL, if that makes it any easier...
Cheers,
|
Nick |
Edited by - nickw on 02 June 2003 16:10:43 |
|
|
masterao
Senior Member
Sweden
1678 Posts |
|
nickw
Junior Member
Ireland
193 Posts |
Posted - 03 June 2003 : 07:46:37
|
Thanks Jan...
No problem. I am sorry that I can't so anything to help
|
Nick |
|
|
masterao
Senior Member
Sweden
1678 Posts |
Posted - 14 June 2003 : 14:41:19
|
I think I might have a solution for you. I've tested it a bit on my own test-server, and it seems to work ok.
This requires a few changes to inc_header.asp and inc_func_common.asp.
In inc_header.asp, locate the following:
select case Request.Form("Method_Type")
case "login"
strEncodedPassword = sha256("" & Request.Form("Password"))
select case chkUser(strDBNTFUserName, strEncodedPassword,-1)
case 1, 2, 3, 4
Call DoCookies(Request.Form("SavePassword"))
strLoginStatus = 1
case else
strLoginStatus = 0
end select
case "logout"
Call ClearCookies()
end select
Before those lines, paste the following:
if Request.Cookies("myUser")("fakeip") = "" then Response.Cookies("myUser")("fakeip") = DateToStr(Now)
strCheckSession = Request.Cookies("myUser")("fakeip")
Then, in inc_func_common.asp, locate the following:
'##############################################
'## Active Users ##
'##############################################
Sub ActiveUserTracker()
'Ls3k- Declaire and assign variables.
Dim strUserIP, strScriptName, strQueryString, strUserAgent, strCurrentTime, strTimedOut
strUserIP = Request.ServerVariables("REMOTE_ADDR")
Replace those lines with the following:
'##############################################
'## Active Users ##
'##############################################
Sub ActiveUserTracker()
'Ls3k- Declaire and assign variables.
Dim strUserIP, strScriptName, strQueryString, strUserAgent, strCurrentTime, strTimedOut
' strUserIP = Request.ServerVariables("REMOTE_ADDR")
strUserIP = Request.Cookies("myUser")("fakeip")
Then locate the sub AUHandleLoging() in inc_func_common.asp:
sub AUHandleLoging()
strSql = "DELETE FROM " & strTablePrefix & "ACTIVE_USERS WHERE AU_IP = '" & Chkstring(request.ServerVariables("REMOTE_ADDR"), "SQLString") & "'"
my_conn.execute (strSql)
end sub
Replace that sub with the following:
sub AUHandleLoging()
strSql = "DELETE FROM " & strTablePrefix & "ACTIVE_USERS WHERE AU_IP = '" & Chkstring(Request.Cookies("myUser")("fakeip"), "SQLString") & "'"
my_conn.execute (strSql)
end sub
It worked on my test-server, so I hope that it will work for you too. Im using the date instead for an ip-address, so if two visitors arrive at the exact same time, they will remove each others as it does for everyone for you at the moment. However, given the slight possibility for this to occur, I suspect that it will be very rare. |
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
|
|
nickw
Junior Member
Ireland
193 Posts |
Posted - 15 June 2003 : 08:42:51
|
Again Jan,
I thank you for taking the time to look at this for me....
Sometime' it just amazes me as to how helpful people are on this forum.
I will report back to let you know the results.
Thanks,
|
Nick |
Edited by - nickw on 15 June 2003 08:44:18 |
|
|
masterao
Senior Member
Sweden
1678 Posts |
|
Topic |
|