The Forum has been Updated
        The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
    
                        I have the problem of the forum keeping the cookie alive when closing the window. I am automatically looged in when I start. I do not want this, since people will be logging on via public computers. Can I fix it?
/ Gent
/ Gent<
                / Gent
/ Gent<
                                Posted 
                                
                                
                                
                                    
                                    
                                
                            
                            
                                        Try this:
in inc_top.asp change this code starting around line 61:
further down starting around line 193:
in inc_functions.asp change the DoCookies() function to:
in register.asp change line 268 to:
Remember I didn't have time to check and re-check all the code, but the first few tests at my server worked: Only if you select the "save my password" checkbox before loggin on the username and password are saved after you close the browser.
Pierre Gorissen
Even if you're on the right track,
you'll get run over if you just sit there. Will Rogers<
                                in inc_top.asp change this code starting around line 61:
select case Request.Form("Method_Type")
	case "login"
		select case ChkUser2(Request.Form("Name"), Request.Form("Password"))
			case 1, 2, 3, 4
				Call DoCookies(Request.Form("SavePassword"))
				strLoginStatus = 1
			case else
				strLoginStatus = 0
			end select
	case "logout"
		Call ClearCookies()
		
end select
further down starting around line 193:
<% if (strAuthType = "db") then %>
<td><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>">Username:</font>
<INPUT type="text" name="Name" size="10" value=""></td>
<td><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>">Password:</font>
<INPUT type="password" name="Password" size="10" value=""></td>
<td valign="bottom">
<% if strGfxButtons <> "0" then %>
<INPUT src=button_login.gif type="image" value="Login" id=submit1 name=submit1 border=0 hspace=4>
<% else %>
<% if strGfxButtons = "0" then %>
<INPUT type="submit" value="Login" id=submit1 name=submit1>
<% end if %>
<% end if %>
</td>
<tr>
<td colspan="3" align="left"><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>">
<INPUT type="checkbox" name="SavePassWord" value="true"> Save my Password</font>
</td> <% else %>
in inc_functions.asp change the DoCookies() function to:
sub DoCookies(fSavePassWord)
if strSetCookieToForum = 1 then
Response.Cookies(strCookieURL & "User").Path = strCookieURL
else
Response.Cookies(strCookieURL & "User").Path = "/"
end if
Response.Cookies(strCookieURL & "User")("Name") = Request.Form("Name")
Response.Cookies(strCookieURL & "User")("Pword") = Request.Form("Password")
Response.Cookies(strCookieURL & "User")("Cookies") = Request.Form("Cookies")
if fSavePassWord = "true" then
Response.Cookies(strCookieURL & "User").Expires = dateAdd("d", 30, strForumTimeAdjust)
end if Session(strCookieURL & "last_here_date") = ReadLastHereDate(Request.Form("Name"))
if strAuthType = "nt" then
Session(strCookieURL & "last_here_date") = ReadLastHereDate(Session(strCookieURL & "userID"))
end if
end sub
in register.asp change line 268 to:
Call DoCookies("")
(this needs to be done or else you get an error when registering a new user)Remember I didn't have time to check and re-check all the code, but the first few tests at my server worked: Only if you select the "save my password" checkbox before loggin on the username and password are saved after you close the browser.
Pierre Gorissen
Even if you're on the right track,
you'll get run over if you just sit there. Will Rogers<
                                Posted 
                                
                                
                                
                                    
                                    
                                
                            
                            
                                        You know this is done in an easier way by not allowing the save password function as follows, in inc_header.asp find this:
And change it to:
This removes the Save Password checkbox, and never saves the password to the cookie, thus they are not logged in when the browser is closed.
<
                                Code:
" <input type=""checkbox"" name=""SavePassWord"" value=""true"" tabindex=""-1"" CHECKED><b>Save Login </b>" & _
And change it to:
Code:
" <input type=""hidden"" name=""SavePassWord"" value=""false"" tabindex=""-1"">" & _
This removes the Save Password checkbox, and never saves the password to the cookie, thus they are not logged in when the browser is closed.
<
There are 10 kinds of people, those that understand binary, and those that don't.
                                    
                                Posted 
                                
                                
                                
                                    
                                    
                                
                            
                            
                                        Did you notice the age of the thread ? hehe 2 years old was probably talking about version 3.1 or earlier back then.<
                                        
                                Kiwihosting.Net - The Forum Hosting Specialists
                                    
                                Posted 
                                
                                
                                
                                    
                                    
                                
                            
                            
                                        LOL that's funny... I was researching something else and stubled across this and didn't notice the year... I thought it was only a few weeks old... jeez I'm embarrassed now. LOL
My new motto, I'm here to help, you just have to wait 2 years
<
                                        
                                My new motto, I'm here to help, you just have to wait 2 years
There are 10 kinds of people, those that understand binary, and those that don't.
                                    
                                Last edited by Huntress on 21 November 2002, 09:11
                                
                            
                        
                                Posted 
                                
                                
                                
                                    
                                    
                                
                            
                            
                                        ROFL :) Love the motto Huntress !<
                                        
                                Kiwihosting.Net - The Forum Hosting Specialists
                                    
                                Posted 
                                
                                
                                
                                    
                                    
                                
                            
                            
                                        I officially nominate Huntress to be the "old bug" fixer! 
<
                                        
                                Dave Maxwell
Barbershop Harmony Freak
                                    Barbershop Harmony Freak
                                Posted 
                                
                                
                                
                                    
                                    
                                
                            
                            
                                        Thanks Dave I'm so honored! 
The one good thing about this is the lack of pressure LOL<
                                The one good thing about this is the lack of pressure LOL<
There are 10 kinds of people, those that understand binary, and those that don't.
                                    Email Member
Message Member
Post Moderation
FileUpload
If you're having problems uploading, try choosing a smaller image.
Preview post
Send Topic
                    
                    Loading...