Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using cookies to verify username and password

Posted on 2003-12-01
5
Medium Priority
?
266 Views
Last Modified: 2010-08-05
I am trying to verify username and password information.  The username and password is stored in a mysql database.  My login page uses the following form.  How can I use cookies to check if the user logged in with the correct username and password and be able to use that information to restrict users from getting to certain pages if they are not logged in.  Here is the form code I am using (I don't think the first line is right.  I want to go to ShopCart.html if the loggin information is correct.  If it is not correct, I want to alert the user and stay at the Login.html page.).

<FORM name="login"  action="ShopCart.html" method="post" language="javascript">
      <p> <b>Please Enter your username and password</b>
      <p>Username
        <input type="text" name="cname">
      <p>Password
        <input type="password" name="password2">
      <input type="SUBMIT" value="SUBMIT" name="LOGIN">
</FORM>

Thanks.
0
Comment
Question by:BobbyMc
[X]
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
5 Comments
 
LVL 53

Accepted Solution

by:
Ryan Chong earned 300 total points
ID: 9854664
0
 

Author Comment

by:BobbyMc
ID: 9863222
How would I incorporate the mysql part?  I need to get data from mysql to compare the login info to check to see if it is correct.
0
 
LVL 28

Expert Comment

by:rrz
ID: 9863291
If, you use a session then the container will take of  session id cookie,
then login page could create session bean to hold username and password information.  You could check that session bean  on each page or use a filter.  

You could also consider container managed security( search kennethxu's history for info).

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Read on to get a few ideas on how to promote your next corporate event.
The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

721 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