i need a login page using session in classic asp

Posted on 2010-01-11
Medium Priority
Last Modified: 2012-05-08
i need a page in asp to authiticate user name and password coded inside the asp page
and create a session then in the other pages i need to code to check if the session exists or not.
Question by:Co0L_DBA
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 26291833
To start off you can use the Login control in VS 2008, this will authenticate the user login into the database. Also you create accoutn setups as well.

Checking if session exists : Would look at seeing to pass between the pages if the user is logged in or not using a session variable, or you can use the login view control from VS 2008..

Accepted Solution

djpazza earned 2000 total points
ID: 26292061
You should be able to get what you need from my example.
' Set Username and Password
uname = "admin"
pword = "password"

<% if request("username") = uname AND request("password") = pword then 
session("authuser") = "yes"
session("authuser") = "no"
end if
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<% if session("authuser") = "no" then %>
Please log in<br />
<% if request("check") <>"" then %>
Please check your details
<% end if%>
<form id="form1" name="form1" method="get" action="">
    <input type="text" name="username" id="uname" />
    <input type="text" name="password" id="pword" />
  <p><input name="check" type="hidden" value="check" />
      <input type="submit" name="button" id="button" value="Login" />
<% else %>
You have successfully logged in
<% end if %>

Open in new window


Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question