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

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Can I use the Snitz login for other pages?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kirys
Starting Member

3 Posts

Posted - 18 June 2001 :  08:46:20  Show Profile  Visit Kirys's Homepage
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  Show Profile  Visit MorningZ's Homepage  Send MorningZ an AOL message
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 )


Go to Top of Page

Flaimo
New Member

Austria
72 Posts

Posted - 18 June 2001 :  22:13:08  Show Profile  Visit Flaimo's Homepage  Send Flaimo an AOL message  Send Flaimo an ICQ Message  Send Flaimo a Yahoo! Message
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.
Go to Top of Page

Kirys
Starting Member

3 Posts

Posted - 24 June 2001 :  03:06:59  Show Profile  Visit Kirys's Homepage
Thank You
But how can I add the login page if it is not logged?

Kirys
Kirys Tech 2000: http://www.kt2k.com
Kirys Tech 2000 Forum: http://www.kt2k.com/forum
Go to Top of Page

Dan Martin
Average Member

USA
528 Posts

Posted - 25 June 2001 :  12:13:35  Show Profile  Visit Dan Martin's Homepage  Send Dan Martin an AOL message  Send Dan Martin an ICQ Message  Send Dan Martin a Yahoo! Message
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
Go to Top of Page

barky81
Junior Member

USA
166 Posts

Posted - 25 June 2001 :  14:32:10  Show Profile
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



Go to Top of Page

Flaimo
New Member

Austria
72 Posts

Posted - 25 June 2001 :  17:34:34  Show Profile  Visit Flaimo's Homepage  Send Flaimo an AOL message  Send Flaimo an ICQ Message  Send Flaimo a Yahoo! Message
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)
Go to Top of Page

Dan Martin
Average Member

USA
528 Posts

Posted - 25 June 2001 :  17:45:18  Show Profile  Visit Dan Martin's Homepage  Send Dan Martin an AOL message  Send Dan Martin an ICQ Message  Send Dan Martin a Yahoo! Message
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

Go to Top of Page

barky81
Junior Member

USA
166 Posts

Posted - 26 June 2001 :  14:28:06  Show Profile
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





Go to Top of Page

Dan Martin
Average Member

USA
528 Posts

Posted - 26 June 2001 :  18:36:24  Show Profile  Visit Dan Martin's Homepage  Send Dan Martin an AOL message  Send Dan Martin an ICQ Message  Send Dan Martin a Yahoo! Message
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
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 1.12 seconds. Powered By: Snitz Forums 2000 Version 3.4.07