Author |
Topic  |
|
miiraclle
Starting Member
7 Posts |
Posted - 13 June 2007 : 12:42:25
|
I have an existing database that contains login info into my site. If a user is going to snitz through my site via links, I don't want them to have to login a second time (but they should be validated). How do I accomplish this?
The credentials for Snitz and my site are the same. However, if the user is going directly to snitz, they will have to login. I have imported the usernames and passwords into the snitz database. I MUST keep my existing database as the primary database. Also, I don't need the ability for users to register.
I know there are many topics on this, but I just can't get this to work. Do I just assign a cookie to the user? But then how do I bypass the snitz login screen?
|
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 13 June 2007 : 12:49:07
|
if you have set the cookies up correctly then you should not get a snitz login screen at all. |
 |
|
miiraclle
Starting Member
7 Posts |
Posted - 13 June 2007 : 12:53:03
|
You're right, I was using the wrong variable for the password. Who knew it was so easy!
Thanks!!! |
 |
|
miiraclle
Starting Member
7 Posts |
Posted - 13 June 2007 : 12:54:23
|
Now when I click on any other link in the forum it boots me back to the login screen.. What is going on? |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 13 June 2007 : 13:07:29
|
make sure that in the forums Admin options that you have the cookie mode set to website and not forum (will need to clear out your cookies after changing this setting)
if that doesn't work, maybe you could provide a link so that we can take a look. |
 |
|
miiraclle
Starting Member
7 Posts |
Posted - 13 June 2007 : 13:38:33
|
I set the cookie mode to website. It seems like I can get into the forum from a link after I have logged into the site where the snitz cookie is set. However, I don't think I am truly logged into Snitz because the login/password box shows and when I click on any other link, I get the login page.
Below is my cookie code
Response.Cookies(strUniqueID & "User").Path = "/" Response.Cookies(strUniqueID & "User")("Name") = Cust_ID 'M_NAME Response.Cookies(strUniqueID & "User")("Pword") = password Response.Cookies(strUniqueID & "User").Expires = Now() + 30
When I open cookies, I can see the Snitz00User Cookie, but I don't see the content with my login credentials.. What am I missing? |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 13 June 2007 : 13:50:33
|
couple of questions, 1)are you saving the encrypted or un-encrypted password in the cookie ? you need to save the encrypted password. 2) I'm not sure that now() + 30 will work, you should use dateadd to increase dates, so your problem could be that your cookie is expiring to soon, it should be something like Response.Cookies(strUniqueID & "User").Expires = dateAdd("d", 30, now()) |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
|
miiraclle
Starting Member
7 Posts |
Posted - 13 June 2007 : 14:14:06
|
I changed the expiration date of the cookie and added the password encoding and it appears to be working. I see myself actually logged in and my cookie shows my encoded password. I put a piece of the code below. Thanks!
strEncodedPassword = sha256("" & trim(password)) encpass = strEncodedPassword Response.Cookies(strUniqueID & "User").Path = "/" Response.Cookies(strUniqueID & "User")("Name") = Cust_ID 'M_NAME Response.Cookies(strUniqueID & "User")("Pword") = encpass Response.Cookies(strUniqueID & "User").Expires = DateAdd("d",30,Now()) |
 |
|
|
Topic  |
|