Hi,
Not sure anyone is going to know why this is happening but here it goes.
I have a href which has a hard coded querystring with a username and password when you click on this you get sent through to login.asp below that checks the database and assigns a value to idadmin which is then stored in a cookie response.cookies("idAdmin").
At the bottom of login.asp the user is redirected to menu.asp, menu.asp has an include file called adminverify.asp that checks to see if request.cookies("idAdmin") is alive.
If I response.write(request.cookies("idAdmin")) response.end at the bottom of login.asp I always get the value I want problem is it doesn’t pass the value or should I say, adminverify.asp cannot see the value so redirects the user away.
However, if I just have response.write(request.cookies("idAdmin"))
response.end on the adminverify.asp which comes up blank and then right click and refresh that page the request.cookies("idAdmin”) value appears…. Where does it go and why does it take a second refresh to find it.
Any help would be appreciated.
Default.asp
Login.asp
Top section of Menu.asp
Adminverify.asp
Not sure anyone is going to know why this is happening but here it goes.
I have a href which has a hard coded querystring with a username and password when you click on this you get sent through to login.asp below that checks the database and assigns a value to idadmin which is then stored in a cookie response.cookies("idAdmin").
At the bottom of login.asp the user is redirected to menu.asp, menu.asp has an include file called adminverify.asp that checks to see if request.cookies("idAdmin") is alive.
If I response.write(request.cookies("idAdmin")) response.end at the bottom of login.asp I always get the value I want problem is it doesn’t pass the value or should I say, adminverify.asp cannot see the value so redirects the user away.
However, if I just have response.write(request.cookies("idAdmin"))
response.end on the adminverify.asp which comes up blank and then right click and refresh that page the request.cookies("idAdmin”) value appears…. Where does it go and why does it take a second refresh to find it.
Any help would be appreciated.
Default.asp
Code:
<a href='[URL unfurl="true"]http://ip/uk?AdminPassword=password&adminName=admin'>Enter</a>[/URL]
Login.asp
Code:
<!--#include file="./includes/languages.asp"-->
<!--#include file="../inc/dbFunctions.asp"-->
<!--#include file="../inc/settings.asp"-->
<!--#include file="../inc/getSettingKey.asp"-->
<!--#include file="../inc/allSettings.asp"-->
<!--#include file="../inc/stringFunctions.asp"-->
<%
adminname = Request.QueryString("adminName")
adminPassword = Request.QueryString("AdminPassword")
'on error resume next
dim mySQL, conntemp, rstemp, pemail, ppassword
' form parameters
pAdminName = formatfordb(getuserinput(request.QueryString("adminName"), 250))
pAdminPassword = formatfordb(getuserinput(request.QueryString("adminPassword"), 250))
'response.write(pAdminName)
'response.write(pAdminPassword)
'response.end
if (pAdminName) = "" or (pAdminPassword) = "" then
response.redirect "[URL unfurl="true"]http://ip/uk"'index.asp?message="&dictLanguageAdmin.Item(session("adminlanguage")&"_admin_login_2")[/URL]
end if
' check if data is correct and initialize admin session
'mySQL="SELECT * FROM wce_sys..wces_users WHERE wce_uid='" &pAdminName& "' AND wce_pw='" &pAdminPassword& "'"
mySQL="SELECT * FROM admins WHERE adminName='" &pAdminName& "' AND adminPassword='" &pAdminPassword& "'"
call getFromDatabase(mySQL, rstemp, "login")
if rstemp.eof then
response.redirect "http:/ip /wceweb.dll"
end if
response.cookies("idAdmin")= rstemp("idAdmin")
response.cookies("idAdmin").Expires=date+1
‘response.write(request.cookies("idAdmin"))
‘response.end
call closeDb()
response.redirect "menu.asp"
%>
Top section of Menu.asp
Code:
<%
pidadmin= request.cookies("idAdmin")
pageId = 19
%>
<!--#include file="adminVerify.asp"-->
<!--#include file="../inc/settings.asp"-->
<!--#include file="../inc/dbFunctions.asp"-->
<!--#include file="../inc/getSettingKey.asp"-->
<!--#include file="./includes/auxFunctions.asp"-->
<%pcompany = getsettingkey("pcompany")%>
<!--#include file="header.asp"-->
<%
Adminverify.asp
Code:
<%
response.write(request.cookies("idAdmin"))
response.end
idAdmin = request.cookies("idAdmin")
if idAdmin="" then
response.redirect "[URL unfurl="true"]http://ip/uk/wceweb.dll"[/URL]
end if
%>