|
winter -> Setting a new Session variable for Spooky Login Question (6/13/2009 0:02:06)
|
Hi All – I am setting out to learn something new and need some help. Using FP03, Spooky Login Dev Edition and an Access 2000 DB, I have a form pre-populated with session variables. The key variable that is not working is one for “AccountExpires”. I would like the actual date recorded in a hidden field. In the Spooky Admin Settings I have checked off Extended fields, use cookies, use sessions. But I have noticed that Account Expires is not actually in the list of session variables. Sooo searching the forum extensively I found this answer (add the new variable to the list in a_general.asp) which i attempted and tried to modify. (see the code below) http://www.frontpagewebmaster.com/m-190493/key-set%252Cvariables/tm.htm#190493 End Sub '------------------------ Function Delim() Delim = IFF(strDbase="SQL" OR strDbase="MYSQL","'","#") End Function '------------------------ Sub CheckForAdmin() If (lCase(Session(appName&"Admin"))="false" or Session(appName&"Admin")&""="") OR (Session(appName&"Username")&""="" AND lCase(Session(appName&"Admin"))="true") then Call XRedirect(strLoginPage &"?Redirect="& Request.ServerVariables("URL")&"?" &Request.Servervariables("QUERY_STRING")) Response.clear Response.endResponse.Cookies(COOKIE_NAME)("xExpires") = IIF(isDate(AccExpires),AccExpires,"") ' New line below Response.Cookies(COOKIE_NAME)("UserID") = UserID '.... End Sub End if End Sub '------------------------ Sub SetCookie() Dim tmpExpiry : tmpExpiry = Request.Cookies(cookie_name)("xExpires") Response.Cookies(cookie_name).expires = IFF(isDate(AccountExpires),AccountExpires,Date+1000) Response.Cookies(cookie_name).path = "/" Response.Cookies(cookie_name)("T1aUs") = IFF(Len(Username),Username,"") Response.Cookies(cookie_name)("T2aPd") = IFF(Len(Password),Password,"") Response.Cookies(cookie_name)("UserID") = IFF(Len(UserID),UserID,"") Response.Cookies(cookie_name)("FirstName") = IFF(Len(x_firstname),x_firstname,"") Response.Cookies(cookie_name)("LastName") = IFF(Len(x_lastname),x_lastname,"") Response.Cookies(cookie_name)("AccessLevel")= IFF(Len(AccessLevel),AccessLevel,"") Response.Cookies(cookie_name)("xEmail") = IFF(Len(x_email),x_email,"") Response.Cookies(cookie_name)("xaddress") = IFF(Len(x_address),x_address,"") Response.Cookies(cookie_name)("xCity") = IFF(Len(x_city),x_city,"") Response.Cookies(cookie_name)("xZip") = IFF(Len(x_zip) ,x_zip,"") Response.Cookies(cookie_name)("xState") = IFF(Len(x_state),x_state,"") Response.Cookies(cookie_name)("xCountry") = IFF(Len(x_country),x_country,"") Response.Cookies(cookie_name)("xPhone") = IFF(Len(x_phone),x_phone,"") Response.Cookies(cookie_name)("xCellPhone") = IFF(Len(x_cellphone),x_cellphone,"") Response.Cookies(cookie_name)("xFax") = IFF(Len(x_fax),x_fax,"") Response.Cookies(cookie_name)("xCompany") = IFF(Len(x_company),x_company,"") Response.Cookies(cookie_name)("xExpires") = IFF(isDate(AccountExpires),AccountExpires,tmpExpiry) End Sub '------------------------ Sub ClearCookie() Response.Cookies(cookie_name)="" Response.Cookies(cookie_name).path ="/" Response.Cookies(cookie_name).expires=Date-1000 End Sub '------------------------ Sub SetSession() Session(appName&"UserID") = IFF(UserID&""="",request.form("UserID"),UserID) Session(appName&"UserName") = IFF(UserName&""="",request.form("UserName"),UserName) Session(appName&"AccessLevel") = IFF(AccessLevel&""="",request.form("AccessLevel"),AccessLevel) Session(appName&"Admin") = IFF(Admin&""="",request.form("Admin"),Admin) Session(appName&"x_firstname") = IFF(x_firstname&""="",request.form("x_firstname"),x_firstname) Session(appName&"x_lastname") = IFF(x_lastname&""="",request.form("x_lastname"),x_lastname) If l_use_session then Session(appName&"x_email") = x_email Session(appName&"x_company") = IFF(x_company&""="",request.form("x_company"),x_company) Session(appName&"x_address") = IFF(x_address&""="",request.form("x_address"),x_address) Session(appName&"x_city") = IFF(x_city&""="",request.form("x_city"),x_city) Session(appName&"x_state") = IFF(x_state&""="",request.form("x_state"),x_state) Session(appName&"x_zip") = IFF(x_zip&""="",request.form("x_zip"),x_zip) Session(appName&"x_country") = IFF(x_country&""="",request.form("x_country"),x_country) Session(appName&"x_phone") = IFF(x_phone&""="",request.form("x_phone"),x_phone) Session(appName&"x_cellphone") = IFF(x_cellphone&""="",request.form("x_cellphone"),x_cellphone) Session(appName&"x_fax") = IFF(x_fax&""="",request.form("x_fax"),x_fax) Session(appName&"x_website") = IFF(x_website&""="",request.form("x_website"),x_website) Session(appName&"x_Userfound") = IFF(x_Userfound&""="",request.form("x_Userfound"),x_Userfound) Session(appName&"x_spare") = IFF(x_spare&""="",request.form("x_spare"),x_spare) Session(appName&"XExpires") = IFF(XExpires&""="",request.form("XExpires"),x_XExpires) ----------------------------------------------------------------------------------------------------------------------- Now the admin area for the login doesn’t work and the form still does not collect the date. Here is the session variable that I tried to use: <%=Session("AccountExpires")%> as well as <%=Session("XExpires")%> ... but no luck I am getting lost. Any ideas? Help is appreciated! Carolyn
|
|
|
|