ASP Tutorial. Application Handling Part I: 3/15/02



Similar documents
Active Server Pages Reference Brian Lalonde

ASP (Active Server Pages)

Multimedia im Netz Online Multimedia Winter semester 2015/16. Tutorial 03 Major Subject

Tech Note 813 Troubleshooting Wonderware Information Server (WIS) Part Four: Client License Release

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

Working With Virtual Hosts on Pramati Server

Using IIS and UltraDev Locally page 1

Internet Technologies. World Wide Web (WWW) Proxy Server Network Address Translator (NAT)

Fachgebiet Technische Informatik, Joachim Zumbrägel

Short notes on webpage programming languages

1 Introduction: Network Applications

Repeater. BrowserStack Local. browserstack.com 1. BrowserStack Local makes a REST call using the user s access key to browserstack.

InduSoft Thin Client Setup and Troubleshooting Guide

c. Write a JavaScript statement to print out as an alert box the value of the third Radio button (whether or not selected) in the second form.

ShoreTel Advanced Applications Web Utilities

5. At the Windows Component panel, select the Internet Information Services (IIS) checkbox, and then hit Next.

DATA COMMUNICATOIN NETWORKING

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ MEng. Nguyễn CaoĐạt

Architecture and Data Flow Overview. BlackBerry Enterprise Service Version: Quick Reference

Novell Identity Manager

Communication Protocol Adapters in Sterling Integrator IBM Corporation

Using SAP Logon Tickets for Single Sign on to Microsoft based web applications

Interwise Connect. Working with Reverse Proxy Version 7.x

Configuring IBM WebSphere Application Server 7.0 for Web Authentication with SAS 9.3 Web Applications


Secure Messaging Server Console... 2

IIS Sites Transfer 2.0 Quick Start Guide

FINAL DoIT v.8 APPLICATION SECURITY PROCEDURE

PHP COOKIES, SESSIONS,

Configuring.NET based Applications in Internet Information Server to use Virtual Clocks from Time Machine

Xtreeme Search Engine Studio Help Xtreeme

WIRIS quizzes web services Getting started with PHP and Java

Password Reset PRO. Quick Setup Guide for Single Server or Two-Tier Installation

EPiServer Operator's Guide

JobScheduler Web Services Executing JobScheduler commands

VB.NET - WEB PROGRAMMING

PC Monitor Enterprise Server. Setup Guide

Installation & Configuration Guide Version 2.2

OVERVIEW OF ASP. What is ASP. Why ASP

Introduction to Server-Side Programming. Charles Liu

Password Reset PRO INSTALLATION GUIDE

The full setup includes the server itself, the server control panel, Firebird Database Server, and three sample applications with source code.

Implementing Specialized Data Capture Applications with InVision Development Tools (Part 2)

Virtual CD v10. Network Management Server Manual. H+H Software GmbH

VMware vcenter Discovered Machines Import Tool User's Guide Version for vcenter Configuration Manager 5.3

An Introduction To The Web File Manager

Documentum Content Distribution Services TM Administration Guide

Computer Networks. Lecture 7: Application layer: FTP and HTTP. Marcin Bieńkowski. Institute of Computer Science University of Wrocław

An Insight into Cookie Security

SiteCelerate white paper

Government Girls Polytechnic, Bilaspur

USER GUIDE. Lightweight Directory Access Protocol (LDAP) Schoolwires Centricity

DEPLOYMENT GUIDE Version 1.0. Deploying the BIG-IP LTM with Apache Tomcat and Apache HTTP Server

1. When will an IP process drop a datagram? 2. When will an IP process fragment a datagram? 3. When will a TCP process drop a segment?

Web+Center Version 7.x Windows Quick Install Guide 2 Tech Free Version Rev March 7, 2012

ACCESSING THE PROGRESS OPENEDGE APPSERVER FROM PROGRESS ROLLBASE USING JSDO CODE

CTIS 256 Web Technologies II. Week # 1 Serkan GENÇ

JAVASCRIPT AND COOKIES

Lecture 11 Web Application Security (part 1)

JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK

Slide.Show Quick Start Guide

FileMaker Server 8. Administrator s Guide

Contents About the Contract Management Post Installation Administrator's Guide... 5 Viewing and Modifying Contract Management Settings...

Migrating helpdesk to a new server

IMRG Peermap API Documentation V 5.0

Cookies Overview and HTTP Proxies

PaperPort PSP Server 3 SERVER ADMINISTRATOR S GUIDE

Contents. 2 Alfresco API Version 1.0

Fig (1) (a) Server-side scripting with PHP. (b) Client-side scripting with JavaScript.

Logi Ad Hoc Reporting Configuration for Load Balancing (Sticky Sessions)

How to configure the DBxtra Report Web Service on IIS (Internet Information Server)

PCRecruiter Resume Inhaler

Advanced Tornado TWENTYONE Advanced Tornado Accessing MySQL from Python LAB

CIS 445 Advanced Visual Basic.NET ASP.NET

CSE 135 Server Side Web Languages Lecture # 7. State and Session Management

How To Enable A Websphere To Communicate With Ssl On An Ipad From Aaya One X Portal On A Pc Or Macbook Or Ipad (For Acedo) On A Network With A Password Protected (

Getting Started with AWS. Hosting a Static Website

Protocolo HTTP. Web and HTTP. HTTP overview. HTTP overview

Products that are referred to in this document may be trademarks and/or registered trademarks of the respective owners.

D0256 HotelTV2 FTP Release Preparation REV A0.5

WirelessOffice Administrator LDAP/Active Directory Support

NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide

COMP 112 Assignment 1: HTTP Servers

FOR PARALLELS / PLESK PANEL

Outline Definition of Webserver HTTP Static is no fun Software SSL. Webserver. in a nutshell. Sebastian Hollizeck. June, the 4 th 2013

The Web Web page Links 16-3

Web Analytics Understand your web visitors without web logs or page tags and keep all your data inside your firewall.

Installing Globodox Web Client on Windows 7 (64 bit)

ASP &.NET. Microsoft's Solution for Dynamic Web Development. Mohammad Ali Choudhry Milad Armeen Husain Zeerapurwala Campbell Ma Seul Kee Yoon

IQSweb Reference G. ROSS Migration/Registration

Introduction to LAN/WAN. Application Layer (Part II)

External Vulnerability Assessment. -Technical Summary- ABC ORGANIZATION

System Administration Guide

Connecting with Computer Science, 2e. Chapter 5 The Internet

Transcription:

ASP Tutorial Application Handling Part I: 3/15/02 Agenda Managing User Sessions and Applications Section I Groundwork for Web applications Topics: Asp objects, IIS, global.asa Section II Application Objects Topics: Methods & Events, Contents, Static Objects Section III Sessions Objects Topics: Methods, Events, Properties, Contents, Static Objects, Session Problems Section IV Cookies Topics: Example, Usage Appendix A Example global.asa file

Section I Groundwork for Web Applications Objects in ASP 3.0 7 built-in objects Covered already Covered today Others Request Application ASPError Response Session ObjectContext Server Internet Information Server (IIS) IIS or Internet Server Manager (ISM) IIS 5 my machine Option pack 4 IIS 4 ltl6 ISM 3 ltl22, ltl10 Defining a Web application is IIS all ASP, JSP, XML, HTML pages that reside under a virtual directory (subfolders included) & set application properties What s a virtual directory? What s an alias? What s a virtual server? Note: multiple virtual servers are only available with the Server version of II5 Uniquely identified by one of (IP, TCP port number, Host header name) http://ltl6, http://ltl6:7200, http://ltl6:25803 What s a Web Site What s the difference? What are the benefits of a virtual server? global.asa (see Appendix A) Must go in the root folder of your web application Only one global.asa file per application. Application_OnStart Application_OnEnd Session_OnStart Session_OnEnd Declaring Objects: <OBJECT RUNAT=Server SCOPE=Scope ID=Application PROGID= prodgid ></OBJECT> or <OBJECT RUNAT=Server SCOPE=Scope ID=Application CLASSID= ClassID ></OBJECT>

Section II Applications Objects Methods: Application.Contents.Remove Application.Contents.RemoveAll Application.Lock Application.Unlock Events: Application_OnEnd Application_OnStart HTTP by nature is a client driven protocol. A stateless environment All users share one application object. (Application-Scope Variable) Application( Name ) = VISCApps Application( Name ) IIS Server Application 1 Application 2 Application 3 ASP Application Object 1 Application Object 2 Application Object 3 Session 1 Session 1 Session 1 Session 2 Session 2 Session 2 Session 3 Session 3 Session 3 Good use is with storing DB connection information Application level variables are actually elements of the Application object

The Application object has 2 Collections: 1. Contents all variables added by scripts commands Application.Contents ( myappvariable ) or Application ( myappvariable ) For each Key in Application.Contents some script code Next 2. Static Objects All objects added with the <object> tag in the global.asa in the application scope Application Object Methods Methods explained: Remove removes a variable Application.Contents.Remove( myappvariable ) RemoveAll removes all the variables for the Application Object Application.Contents.RemoveAll Lock only the one currently accessing the variable can make changes Unlock frees a previously lock variable

Section III Sessions Objects Methods: Abandon Remove RemoveAll Events: Session_OnStartt Session_OnEnd How to deal with dynamic pages so we can make more than one request? Session Objects - Allows the sever/developer to track a user from page to page in an application. Example: finance.yahoo.com The user session starts when the user first hits any of the pages in the application Allows us to treat a user s interaction with the web site with in a specified period of time, as a set of saved variables, rather than just a disconnected series of page request Classic example: Shopping basket Authentication tag

The Session object has 2 Collections: 1. Contents Session.Contects( key ) or Session( key ) Session( FirstName ) = Mary Session( FirstName ) For Each item in Session.Contents If IsObject(Session.Contents(item)) Then Response.Write( Item & item & is an object, can t display ) Else If IsArray(Session.Contents(item)) Then Response.Write Array: & Session.Contents(item) For each objarray in Session.Contents(item) Response.Write Session.Contents(item)(objArray) & <BR> Next Else Response.Write( Item & : & Session.Contents(item) & <BR> ) End If Next 2. StaticObjects All objects added with the <object> tag in the global.asa in the session scope Session Object Properties SessionID session ID number for each user Session.SessionID Timeout sets the Session timeout property directly (in minutes) Session.Timeout = 30 Session Object Methods Abandon Destroys the user session Session.Abandon Remove RemoveAll Problem with ending Sessions: Fires when the timeout fires not when the user leaves the site or closes the browser. How long should the server wait while storing all the users information and using up server resources?

Section IV Cookies Example: www.msnbc.com Cookies acts as an identifier so the sever knows which set of session information on the server is associated with which request. (John Peterson, www.devguru.com) Text files written by the client s browser containing info send by the web server, on the clients computer. Using Cookies in ASP Creating cookies: Response.Cookies( cookiename ) = value HTML output Set-Cookie:YOURCOOKIENAME=somevalue Retrieving cookies: Display cookie contents: Request.Cookies( cookiename ) ( keyname ).attribute Response.Write Request.Cookies( cookiename ) Set key value: Response.Cookies( cookiename )( keyname ) = value Set Expiration Date: Response.Cookies( cookiename ).Expires = July 4, 2002 Response.Cookies( cookiename ).Expires = Date + 1 Deleting cookies: Response.Cookies( cookiename ).Expires = Date 1 See Cookie examples: login.asp & Checklogin.asp login2.asp & Checklogin2.asp

Appendix A -------------------------------------------------------Global.asa----------------------------------------------------------- <Script Language="VBScript" RUNAT=Server> Sub Application_OnEnd() End Sub Sub Application_OnStart() Application("NumSession") = 0 Application("NumVisited") = 0 Session.Timeout = 10 End Sub Sub Session_OnEnd() Application("NumSession") = Application("NumSession") - 1 End Sub Sub Session_OnStart() Application("NumSession") = Application("NumSession") + 1 Application("NumVisited") = Application("NumVisited") + 1 End Sub </Script> -------------------------------------------------------home.asp------------------------------------------------------------ <HTML> <BODY> Response.Write "You are " & Application("NumSession") & " of " & Application("NumVisited") & " users." </BODY> </HTML> --------------------------------------------------------output-------------------------------------------------------------- You are 2 of 6 users.