Author |
Topic |
GauravBhabu
Advanced Member
4288 Posts |
Posted - 13 September 2002 : 20:28:15
|
Active.asp
Lines 126-132
Statement in red may be removed.
if Request.Form("AllRead") = "Y" then
Session(strCookieURL & "last_here_date") = Request.Form("BuildTime")
Session(strCookieURL & "last_here_date") = Request.Form("BuildTime")
lastDate = Session(strCookieURL & "last_here_date")
UpdateLastHereDate Request.Form("BuildTime"),strDBNTUserName
ActiveSince = ""
end if |
CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain
It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
Prayer Of Forgiveness "I forgive all living beings. May all living beings forgive me! I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated) |
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 13 September 2002 : 20:39:20
|
no it may not
Things in the code are there for a reason. Please at least investigate things before coming out and saying "This may be removed". |
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 13 September 2002 : 20:54:49
|
for the same reason that we need this twice:
Session(strCookieURL & "AllowedForums" & MemberID) = isAllowedMember2 Session(strCookieURL & "AllowedForums" & MemberID) = isAllowedMember2
in the isAllowedMember function, if it's not set twice like this, then when you try to read the value back from the Session Cookie, it doesn't work. Remember the bug we had on this forum for a little while where normal users could see topics that they shouldn't see on the active.asp page? setting this twice, like shown above, is what fixed it. |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
|
Doug G
Support Moderator
USA
6493 Posts |
Posted - 13 September 2002 : 21:10:04
|
May I suggest a small code modification. I probably would have deleted the extra line without thinking twice about it.
if Request.Form("AllRead") = "Y" then
'The redundant line below is necessary, don't delete it.
Session(strCookieURL & "last_here_date") = Request.Form("BuildTime")
Session(strCookieURL & "last_here_date") = Request.Form("BuildTime")
lastDate = Session(strCookieURL & "last_here_date")
UpdateLastHereDate Request.Form("BuildTime"),strDBNTUserName
ActiveSince = ""
end if
Never mind, I read the link Richard posted above and saw there are comments in the code.
|
====== Doug G ====== Computer history and help at www.dougscode.com |
Edited by - Doug G on 13 September 2002 21:12:08 |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 13 September 2002 : 21:11:13
|
I can do that, it used to be in there, but that section was modified and the comment got deleted along with it. |
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
|
Doug G
Support Moderator
USA
6493 Posts |
Posted - 13 September 2002 : 21:12:56
|
Richard you are too fast
|
====== Doug G ====== Computer history and help at www.dougscode.com |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 13 September 2002 : 21:27:35
|
from beta 5 of v3.4:
if Request.Form("AllRead") = "Y" then
'## the following 2 lines are duplicated on purpose
Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTUserName)
Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTUserName)
lastDate = Session(strCookieURL & "last_here_date")
ActiveSince = ""
end if
beta 11 is where it was first changed:
if Request.Form("AllRead") = "Y" then
Session(strCookieURL & "last_here_date") = Request.Form("BuildTime")
lastDate = Session(strCookieURL & "last_here_date")
ActiveSince = ""
end if
between rc2 and v3.4 Final it was changed to this:
if Request.Form("AllRead") = "Y" then
Session(strCookieURL & "last_here_date") = Request.Form("BuildTime")
Session(strCookieURL & "last_here_date") = Request.Form("BuildTime")
lastDate = Session(strCookieURL & "last_here_date")
UpdateLastHereDate Request.Form("BuildTime"),strDBNTUserName
ActiveSince = ""
end if
because it wasn't working as expected with just the single line. |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 13 September 2002 : 22:11:30
|
When the session variable was populated by call to function ReadLastHereDate there was a reason to do it twice as mentioned in the post by gor at the link you posted:
quote: If you like, try what happens if you remove one and click on the icon to mark all topics as read (in-active). It won't work, because the first call only causes the Last Here Date in the database to be updated, and returns the Last Here Date that was in the database before. The second call re-reads the changed Last Here Date from the database.
But in the current version the values are coming from the same Form field and values in the form field are not changing. As the dev team tested prior to release, the single statement did not work as expected. Why? (I am sure the question must have come up in the dev team discussions.) Seems to be another unresolved application behavior.
However, I have seen this behavior while getting syatem dates using API functions, where we need to populate the variable with empty spaces (to make sufficient room in the buffer to receive the date string) before the variable can be passed to the API function to be populated with the values. I have not found anything about this behavior in relation to session variables though.
I posted because, I did not see the discussion about this. The one which is there, is in a different context, though having the same effect. If it annoys or is not taken well then what about, "We are all here to learn." |
CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain
It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
Prayer Of Forgiveness "I forgive all living beings. May all living beings forgive me! I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated) |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 14 September 2002 : 04:04:18
|
You're right GB. We appreciate your postings on suggesting these modifications, to make the code better. |
Support Snitz Forums
|
|
|
Deleted
deleted
4116 Posts |
Posted - 14 September 2002 : 13:43:58
|
quote: Originally posted by Davio
You're right GB. We appreciate your postings on suggesting these modifications, to make the code better.
Yeah, sure . |
Stop the WAR! |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 14 September 2002 : 14:05:32
|
quote: Originally posted by bozden
Yeah, sure .
Is there a hint of sarcasm I detect in that? |
Support Snitz Forums
|
|
|
Deleted
deleted
4116 Posts |
Posted - 14 September 2002 : 14:24:00
|
quote: Originally posted by Davio
quote: Originally posted by bozden
Yeah, sure .
Is there a hint of sarcasm I detect in that?
Just in the contrary, I tried to emphesize that I have the same opinion!
I always appreciate people posting here with well phrased ideas, additions and corrections - whether they are small or large, whether they are positive or negative.
Maybe, it is my lack of language proficiency... Sorry if it sounded different ...
|
Stop the WAR! |
|
|
Doug G
Support Moderator
USA
6493 Posts |
Posted - 14 September 2002 : 16:06:43
|
Hi Bozden, when you come over here to visit, and overhear a conversation where some guy in a pub is telling his friend "Hey, I just won the $100 million dollar lottery" and his friend says "Yeah, sure" you'll know its a sarcastic reply you're hearing.
Semantics is a great subject. I am not even bilingual, but I can imagine how difficult it is to try to get all the subtle nuances of a 2nd language down pat!
quote: Maybe, it is my lack of language proficiency... Sorry if it sounded different ...
My opinion is you have an excellent command of English.
|
====== Doug G ====== Computer history and help at www.dougscode.com |
|
|
Topic |
|