Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 26th, 2005, 06:19 AM
Registered User
 
Join Date: Nov 2004
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to start a session


how can i start a session in ASP ?

i'm developing a webapplication with Dreamweaver MX 2004, i created a login page which need to pass "ID" from the users DB to the protected page after successful login, so i can pass the user's " first name and last name " ... so it displays something like :

welcome to our page FIRSTNAME LASTNAME

can somebody help me with this please

Kind Regards

  #2 (permalink)  
Old July 26th, 2005, 07:29 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Sessions are started as soon as the browser is fired up.

;;;need to pass "ID" from the users DB to the protected page after successful login
When you are checking the user details against the DB and find a match, store thier unique id in a session variable:
session("UID") = RS(0)
NOTE:The recordset RS holds the user details, the first element (0) is the unique ID for this user (commonly called ID)

Now what ever page you go to this variable is available. If you want to protect a page by only letting logged in users access it place the following code at the top of the page:

<% if session("UID") = "" then
      response.redirect("somPageName"
   end if %>


Wind is your friend
Matt


Similar Threads
Thread Thread Starter Forum Replies Last Post
don't know where to start timbal25 Access VBA 1 October 18th, 2007 02:17 PM
Session Start Error Sean1989 Beginning PHP 1 July 3rd, 2006 01:49 PM
Login Authentication: session start( ) Problem!! jivogxf BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 August 18th, 2005 11:42 PM
session and cookie problem (empty session file) msincan BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 February 27th, 2005 05:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.