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

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 (redundant code 3.4.03) if strSetCookieToForum = "
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

bjlt
Senior Member

1144 Posts

Posted - 12 October 2002 :  21:14:55  Show Profile
(redundant code 3.4.03) if strSetCookieToForum = "1" then...strCookieURL

There are several places where you can find code like this:


if strSetCookieToForum = "1" then
	Response.Cookies(strCookieURL & "NumDays").Path = strCookieURL
end if
Response.Cookies(strCookieURL & "NumDays") = Request.Form("days")


if you use strCookieURL then there's no need to check for strSetCookieToForum, either it's redundant or it should be Response.Cookies(strUniqueID ...

search for strSetCookieToForum and see if the following code is strCookieURL

Moved from DEV Bug Reports by Davio

Edited by - Davio on 13 February 2003 11:14:55

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 12 October 2002 :  23:31:54  Show Profile  Visit HuwR's Homepage
I think you have misunderstood, it is checking to see if you are using forum based cookies, and if you are it sets the ath value for the cookie, and if you are not, it does not set a path attribute for the cookie, so no it is not redundant.
Go to Top of Page

bjlt
Senior Member

1144 Posts

Posted - 12 October 2002 :  23:37:22  Show Profile
but strCookieURL is already the path of the forum, if you have two forums in two folders, you'll have different coockies already. There's no need for a path.

e.g.
/forum1
cookie: forum1NumDays.path = forum1
/forum2
cookie: forum2NumDays.path = forum2

but they are two different cookies already, am I right here?

It's needed for strUniqueID though.

Edited by - bjlt on 13 October 2002 15:37:53
Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 13 October 2002 :  09:01:09  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
strCookieURL is NOT the path for the forum if you are using the website based cookie. Then it uses the path to the website instead of the path to the forum....

Dave Maxwell
Barbershop Harmony Freak
Go to Top of Page

bjlt
Senior Member

1144 Posts

Posted - 13 October 2002 :  09:36:45  Show Profile
quote:




if strSetCookieToForum = "1" then
	Response.Cookies(strCookieURL & "NumDays").Path = strCookieURL
end if
Response.Cookies(strCookieURL & "NumDays") = Request.Form("days")





Aren't code like this checking if the coockie is set to FORUM?


and


strCookieURL = Left(Request.ServerVariables("Path_Info"), InstrRev(Request.ServerVariables("Path_Info"), "/"))


are actually always the current path?

Edited by - bjlt on 13 October 2002 15:38:00
Go to Top of Page

bjlt
Senior Member

1144 Posts

Posted - 13 October 2002 :  09:44:42  Show Profile
Three instances are found in v3.4.03
active.asp 2
forum.asp 1

Find if strSetCookieToForum = "1" then and see if it's followed by
Response.Cookies(strCookieURL , if so you can removed the if then end if block for it.


if strSetCookieToForum = "1" then
	Response.Cookies(strCookieURL & "...").Path = strCookieURL
end if



Please note that I'm NOT talking code like this


if strSetCookieToForum = 1 then
  Response.Cookies(strUniqueID & "...").Path = strCookieURL
end if



Edited by - bjlt on 13 October 2002 15:38:07
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 13 October 2002 :  11:51:49  Show Profile  Visit HuwR's Homepage
it is to do with the way cookies are related to the website, just because strCookieURL is different, does not mean anything, since they are YOUR variables, and still relate to your websites root, setting the Path property however, relates the cookies to the forums subdirectory and not your websites root.
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 13 February 2003 :  11:13:26  Show Profile
The code will be left in the base code since it is not causing any errors or bugs.

Support Snitz Forums

Edited by - Davio on 13 February 2003 11:14:04
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.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07