Author |
Topic  |
|
Kirys
Starting Member
3 Posts |
Posted - 18 June 2001 : 08:46:20
|
I would like to allow accessing to some areas of my web sites only to people that subscibed the forum. And maybe also detect if the user is or not a moderator or an administrator. Bye Kirys
Kirys Kirys Tech 2000: http://www.kt2k.com Kirys Tech 2000 Forum: http://www.kt2k.com/forum |
|
MorningZ
Junior Member
 
USA
169 Posts |
Posted - 18 June 2001 : 21:38:56
|
absolutely...
you just have to check for the cookies that Snitz write....
are you using the "standard" setup ( in other wordsa you didnt mess with any of the variables in the config.asp dealing with naming vars )
 |
 |
|
Flaimo
New Member

Austria
72 Posts |
Posted - 18 June 2001 : 22:13:08
|
i can't even manage to read the cookie if the asp file is not in the forum folder. the forum folder is a subfolder to the rootfolder where the asp files are in which i want to display the username. i have the messageboard cookie set to "forum" because i have 2 differen boards on the same domain. |
 |
|
Kirys
Starting Member
3 Posts |
|
Dan Martin
Average Member
  
USA
528 Posts |
Posted - 25 June 2001 : 12:13:35
|
quote:
i can't even manage to read the cookie if the asp file is not in the forum folder. the forum folder is a subfolder to the rootfolder where the asp files are in which i want to display the username. i have the messageboard cookie set to "forum" because i have 2 differen boards on the same domain.
Well, this is true....price you pay for setting cookie to forum. There's a better option. Change both cookies to "website", but change the prefix for the cookies to two different things in each.
In config.asp, around line 89, you should see this line: strUniqueID = "Snitz00"
Change that in one forum to: strUniqueID = "Forum1" (replace with something relevant)
and something else in the other: strUniqueID = "Forum2" (replace with something relevant)
This will allow you to use two forums on the same website, and still write to their cookies from anywhere.
-Dan
Edited by - Dan Martin on 25 June 2001 12:19:51 |
 |
|
barky81
Junior Member
 
USA
166 Posts |
Posted - 25 June 2001 : 14:32:10
|
Don't think so...based on all past discussion that I know of anyway...
Could you expand on your explanation?
Please read the past posts on "forum" versus "website" and also regarding "struniqueID"--just search these terms.
Full details on the situation would be appropriate: If there are two separate forums, do they use separate member tables? etc.quote:
quote:
i can't even manage to read the cookie if the asp file is not in the forum folder. the forum folder is a subfolder to the rootfolder where the asp files are in which i want to display the username. i have the messageboard cookie set to "forum" because i have 2 differen boards on the same domain.
Well, this is true....price you pay for setting cookie to forum. There's a better option. Change both cookies to "website", but change the prefix for the cookies to two different things in each.
In config.asp, around line 89, you should see this line: strUniqueID = "Snitz00"
Change that in one forum to: strUniqueID = "Forum1" (replace with something relevant)
and something else in the other: strUniqueID = "Forum2" (replace with something relevant)
This will allow you to use two forums on the same website, and still write to their cookies from anywhere.
-Dan
Edited by - Dan Martin on 25 June 2001 12:19:51
|
 |
|
Flaimo
New Member

Austria
72 Posts |
Posted - 25 June 2001 : 17:34:34
|
the main page is in german and is in the root directory. then there is a subfolder "forum" with the german messageoard. theres also a second subfolder "en" with the english version of the page. in "en" there's a "forum" subfolder again with the english version of the board. both boards are completly seperated. own, members table, links manager, ..... -> http://charmed-net.de/index2.asp (german) // http://charmed-net.de/en/index.asp (english) |
 |
|
Dan Martin
Average Member
  
USA
528 Posts |
Posted - 25 June 2001 : 17:45:18
|
quote:
Don't think so...based on all past discussion that I know of anyway...
Could you expand on your explanation?
Please read the past posts on "forum" versus "website" and also regarding "struniqueID"--just search these terms.
Full details on the situation would be appropriate: If there are two separate forums, do they use separate member tables? etc.
I looked at the various discussions, and what I said above still holds true.
A cookie is set in ASP with Response.Cookies("myPrefix")("myVariableName") ="myVariableValue"
This results in a cookie that looks like this: myPrefix=myVariableName=myVariableValue
Then to retrieve, var myCookieData = Request.Cookies("myPrefix")("myVariable") In Snitz 2000, the "myPrefix" is set to "Snitz00" in the config.asp. If you have 2 forums, running "website" level cookies, and both have a strUniqueID of "Snitz00", then Request.Cookies(strUniqueID)("someVariable") is going to get the SAME data on the two different forums on the same website. Also, Response.Cookies(strUniqueID)("someVariable") will set the same data on both forums.
If however, you make the strUniqueID different in the config.asp of each forum, they will not.
There is only one issue. If you do what I stated above with an existing forum that is currently in use, all state information that is stored in your cookies for your current user population will be lost. For instance, your users will have to log on the first visit after you make the change. I probably wouldn't advise it if you are running the slemieux poll mod.
But those issues are relatively minor. Since you can never rely on your users NOT deleting their cookies, nothing truely important is saved in the cookie. And anything that does (like the slemieux poll mod) already experiences the pitfalls of trying to use cookies for saving important data.
Hope that clears it up a bit. -Dan
|
 |
|
barky81
Junior Member
 
USA
166 Posts |
Posted - 26 June 2001 : 14:28:06
|
Have you actually done this? Is there a site where I can play with it?
You're saying have one cookie that keeps getting overwritten, right? In other words, If I were to login to forum1, and then visit pages outside the forum1 directory, I would need all code to test for the struniqueID and redirect to the appropriate member database?
And if I visit forum2 (with my already set forum1 cookie) what happens? I have a cookie, but the struniqueID doesn't have the correct value...
It doesn't sound like it works to me...(don't get me wrong, I really curious about how this would work. I have a site with 3 separate forums...and numerous cases of crossover membership: user_A member of forum_1 and forum_3; user_B member of forum_2 and forum_3, etc.)
quote:
I looked at the various discussions, and what I said above still holds true.
A cookie is set in ASP with Response.Cookies("myPrefix")("myVariableName") ="myVariableValue"
This results in a cookie that looks like this: myPrefix=myVariableName=myVariableValue
Then to retrieve, var myCookieData = Request.Cookies("myPrefix")("myVariable") In Snitz 2000, the "myPrefix" is set to "Snitz00" in the config.asp. If you have 2 forums, running "website" level cookies, and both have a strUniqueID of "Snitz00", then Request.Cookies(strUniqueID)("someVariable") is going to get the SAME data on the two different forums on the same website. Also, Response.Cookies(strUniqueID)("someVariable") will set the same data on both forums.
If however, you make the strUniqueID different in the config.asp of each forum, they will not.
There is only one issue. If you do what I stated above with an existing forum that is currently in use, all state information that is stored in your cookies for your current user population will be lost. For instance, your users will have to log on the first visit after you make the change. I probably wouldn't advise it if you are running the slemieux poll mod.
But those issues are relatively minor. Since you can never rely on your users NOT deleting their cookies, nothing truely important is saved in the cookie. And anything that does (like the slemieux poll mod) already experiences the pitfalls of trying to use cookies for saving important data.
Hope that clears it up a bit. -Dan
|
 |
|
Dan Martin
Average Member
  
USA
528 Posts |
Posted - 26 June 2001 : 18:36:24
|
quote: You're saying have one cookie that keeps getting overwritten, right?
No, they won't write over each other at all.
You end up with a cookie like this: Forum1=Cookies=&Pword=hohoho&Name=Santa; Forum2=Cookies=&Pword=hohoho&Name=Santa;
Where Response.Cookies("Forum1")("Pword") = something will only write to the red part, and Response.Cookies("Forum2")("Pword") = something will only write to the blue part.
quote:
user_A member of forum_1 and forum_3; user_B member of forum_2 and forum_3, etc.)
In Snitz, when you logout to log in as another member on forum_1, it would erase the forum_1 values. So this scenario isn't an issue at all. You would only be logged in for any given forum as one person, and would have cookie data for one person per forum.
Lets say you are logged in as user_A on forum_1, user_A on forum_2, and user_B on forum_3:
forum_1=Cookies=&Pword=Apassword&Name=user_A; forum_2=Cookies=&Pword=Apassword&Name=user_A; forum_1=Cookies=&Pword=Bpassword&Name=user_B;
In Snitz, go to your Admin Options>>>>Server Information>>>HTTP_COOKIE. Take a look at how cookies are set up.
quote:
If I were to login to forum1, and then visit pages outside the forum1 directory, I would need all code to test for the struniqueID and redirect to the appropriate member database?
I've merely explained how to have two forums on the same website without having to set the cookie to "forum" level. I never talked about the database.
Edited by - Dan Martin on 26 June 2001 19:08:35 |
 |
|
|
Topic  |
|