Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Authenication of visitor every time they visit

Status
Not open for further replies.

phototaker

Technical User
Mar 6, 2001
126
US
How do I make sure that a visitor can't later come back to a page they have bookmarked without going to the log in page first? Thanks Richard [hammer]
 
?Boolean session variable set in the log-in page?

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'If we're supposed to work in Hex, why have we only got A fingers?'
Essex Steam UK for steam enthusiasts
 
Well, I guess I should give you more info. I have five seperate groups of people who I need to have check in and then send them to the appropriate page where they can see all the linked pages on the site. I have set up a form and processor page in asp and I think from my research that I can set up a cookie and then let every protected page look for it before it loads. I just can't figure how to set the cookie, if that is the easiest way to do it, with a value. This is probably simple but I am confused,I guess. Here is a link to the log in page and her is the code for the processor. I am still setting up so all he links are not live for the destinations.
Log in
Processor page:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<% Dim store, password
store=Request.Form("store")
password=Request.Form("password")
%>
<%
If store="1" and password="trask" Then
Response.Redirect("/EmployeeWebSite/tgg/home.asp")
Else
If store="2" and password="brookhurst" Then
Response.Redirect("store2.asp")
Else
If store="3" and password="lincoln" Then
Response.Redirect("store3.asp")
Else
If store="4" and password="escape" Then
Response.Redirect("store4.asp")
Else
If store="5" and password="pilot" Then
Response.Redirect("/EmployeeWebSite/Honda/home.asp")
Else
Response.Redirect("error.asp")
End If
End If
End If
End If
End If
%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Process Password</title>
</head>

<body>

</body>
</html>

Any help would be appreciated. Richard [hammer]
 
I just keep having trouble getting the cookie to say what I want. I went to the link you provided, I must have looked at ten like that before I came to this forum. I put the
<%
Response.Cookies("firstname")="Alex"
%>
into the processor page and tested it and the cookie I got on my computer in the temp files was richard and not Alex.

I want to assign a "value" that all the pages can make sure is there before it loads.
If you know what I am missing about this please advise. Thanks Much, Richard
 
use a name and value pair

Code:
<%
response.cookies("name")("value") = "something"

' to retrieve

variable = request.cookies("name")("value")

%>

I have some Site Logon code set up and there are some functions for setting, reading and clearing cookies.
I just haven't got round to the write up on it yet. [smile]



Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
I still need some help with this. I've been to your site and there is lots of great information. I have tried several things and still can't get the site to do what I wnat it to. Here is the problem as I see it. I have a login page at that takes the visitor to the processor page with code of:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% Dim store, password
store=Request.Form("store")
password=Request.Form("password")
%>
<%
If store="1" and password="trask" Then
Response.Redirect("/EmployeeWebSite/tgg/home.asp")
Else
If store="2" and password="brookhurst" Then
Response.Redirect("/EmployeeWebSite/NissanGG/home.asp")
Else
If store="3" and password="lincoln" Then
Response.Redirect("/EmployeeWebSite/MDR/home.asp")
Else
If store="4" and password="escape" Then
Response.Redirect("/EmployeeWebSite/Ford/home.asp")
Else
If store="5" and password="pilot" Then
Response.Redirect("/EmployeeWebSite/Honda/home.asp")
Else
If store="6" and password="noarus" Then
Response.Redirect("/EmployeeWebSite/corporate/home.asp")
Else
Response.Redirect("/storelogin/error.asp")
End If
End If
End If
End If
End If
End If
%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>

</body>
</html>

What I want to happen is for each page that the visitor goes to in their stores employee site, no more signing in again is required. I also don't want people to go to the sites pages without signing in. I guess that I could use the same cookie value for all stores pages to look for because it may be easier and the pages aren't linked from site to site. If there were a way to give each employee site a seperate cookie value it would be great.
I am not sure where to put the cookie setting code in the first place- logiin or processor and I guess that there would be some code in the head of every page that read something like:
<%
if Request.Cookies("store")<>"MDR" then
response.redirect("end if
%>

The MDR would repersent on stores ID and the word store might not be needed. that is were I am at now.

Please advise if you would be so kind.
Thanks Richard
 
That would work, but be aware that some visitors may have cookies turned off, this would prevent them from accessing the site. A warning will be required.

Cheech

[Peace][Pipe]
 
I have been working on something set up by someone else and it has gotten me confsed. I have moved the login and all supportive files to another site to start fresh. I have the login and processor page working to make the links to the home pages but the other local pages are looking for a cookie set by the other persons .aspx page done in C#. I have gotten rid of all the cookie code and tried making it work but have had no luck. I want to set a cookie to make the visitor register to get to the pages for each store. I placed the code below that didn't work??
<%
response.cookies("name")("value") = "store"

%>

I want to know the correct code and where to put the code? Does it go on the index.asp or on the processor page?
This code didn't work to retrive even after i put the link in to redirect.
<%
if Request.Cookies("store")<>"MDR" then
response.redirect("place where I want to send them goes here"
end if
%>

I'm not sure what I am doing wrong but its not working. The login page is at and the processor page code is the same as above in an earlier posting. I would like to know what code to put where for one store and I can figure out the rest of them. Any help appereciated.
Confused: [hammer]
Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top