CIS 451: ASP Sessions and Applications Dr. Ralph D. Westfall January, 2009.

Slides:



Advertisements
Similar presentations
Maintaining State Between the Client and Server Internet Programming Using VBScript and JavaScript 9.
Advertisements

Cookies, Sessions. Server Side Includes You can insert the content of one file into another file before the server executes it, with the require() function.
Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
DT211/3 Internet Application Development Active Server Pages & IIS Web server.
Authenticating Users in an ASP.NET Application. Web Site Administration Tool From VS 2008, click Website/ ASP.Net Configuration to open Web Site Administration.
Client State Management & Application Security  Client State Management  Concept  ASP Examples  Application Security  Database Based Approach 
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
 Mark Friedman Architect Developer Division Microsoft Corporation.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
CHAPTER 12 COOKIES AND SESSIONS. INTRO HTTP is a stateless technology Each page rendered by a browser is unrelated to other pages – even if they are from.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
Overview of Previous Lesson(s) Over View  Server controls are small building blocks of the graphical user interface, which includes  Text boxes  Buttons.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
IT533 Lectures Session Management in ASP.NET. Session Tracking 2 Personalization Personalization makes it possible for e-businesses to communicate effectively.
Advanced Web Forms with Databases Programming Right from the Start with Visual Basic.NET 1/e 13.
CIS 375—Web App Dev II ASP II. 2 ASP Session: Introduction The Session _______ is used to store information about, or change settings for a user session.
Session 10: Managing State. Overview State Management Types of State Management Server-Side State Management Client-Side State Management The Global.asax.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Managing State.
State Management. What is State management Why State management ViewState QueryString Cookies.
Chapter 5 Java Servlets. Objectives Explain the nature of a servlet and its operation Use the appropriate servlet methods in a web application Code the.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
Web Programming Language Week 7 Dr. Ken Cosh Security, Sessions & Cookies.
CIS 451: ASP.NET Objects Dr. Ralph D. Westfall January, 2009.
Lecture 8 – Cookies & Sessions SFDV3011 – Advanced Web Development 1.
1 Maryland ColdFusion User Group Session Management December 2001 Michael Schuler
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
Caching Chapter 12. Caching For high-performance apps Caching: storing frequently-used items in memory –Accessed more quickly Cached Web Form bypasses:
CIS 451: ASP.NET Concepts Dr. Ralph D. Westfall January, 2009.
Chapter 6 Server-side Programming: Java Servlets
1 Chapter 9 – Cookies, Sessions, FTP, and More spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
© Minder Chen, ASP.NET - 1 Form Handling and State Maintenance Major Build-in ASP.NET Objects Simple Form Handling HTML Forms More Complex Form.
Christopher M. Pascucci Basic Structural Concepts of.NET Managing State & Scope.
ASP.NET State Management. Slide 2 Lecture Overview Client state management options Cookies Server state management options Application state Session state.
Session and Cookie Management in.Net Sandeep Kiran Shiva UIN:
STATE MANAGEMENT.  Web Applications are based on stateless HTTP protocol which does not retain any information about user requests  The concept of state.
Module 7: Creating a Microsoft ASP.NET Web Application.
Web Database Programming Week 7 Session Management & Authentication.
CSCI 6962: Server-side Design and Programming Java Server Faces Scoping and Session Handling.
Controlling Web Site Access Using Logins CS 320. Basic Approach HTML form a php page that collects the username and password  Sends them to second PHP.
The Problem of State. We will look at… Sometimes web development is just plain weird! Internet / World Wide Web Aspects of their operation The role of.
Lecture Note 8: ASP Including Files and The Global.asa file.
CP476 Internet Computing CGI1 Cookie –Cookie is a mechanism for a web server recall info of accessing of a client browser –A cookie is an object sent by.
CIS 451: Cookies Dr. Ralph D. Westfall February, 2009.
Working With ASP.NET Application. Create a new virtual directory The procedure to create a new virtual directory Internet Services Manager Right click.
Building Applications using ASP.NET and C# / Session 5 / 1 of 19 Session 5.
Configuring and Deploying Web Applications Lesson 7.
Maintaining State in ASP. Problem - How do I maintain state information about the user  Several Methods –Cookies –Session variables –Hidden fields 
ITM © Port,Kazman 1 ITM 352 Cookies. ITM © Port,Kazman 2 Problem… r How do you identify a particular user when they visit your site (or any.
Active Server Pages Session - 3. Response Request ApplicationObjectContext Server Session Error ASP Objects.
7-1 Active Server and ADO Colorado Technical University IT420 Tim Peterson.
Unit-6 Handling Sessions and Cookies. Concept of Session Session values are store in server side not in user’s machine. A session is available as long.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
ASP.NET WEB Applications. ASP.NET  Web application framework developed by Microsoft  Build dynamic data driven web applications and web services  Subset.
ASP.NET State Management Overview Prepared By Manish Kumar Aery(IM66) Department of computer Application IET Bhaddal (Ropar)
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
ASP – Web Programming Class  Ravi Anand. ASP – Active Server Pages What is ASP? - Microsoft Technology - Can Run using IIS/PWS/Others - Helps us create.
Session Variables and Post Back
State Management.
Y.-H. Chen International College Ming-Chuan University Fall, 2004
19.10 Using Cookies A cookie is a piece of information that’s stored by a server in a text file on a client’s computer to maintain information about.
Web Programming Language
MIS Professor Sandvig MIS 324 Professor Sandvig
Configuring Internet-related services
Building ASP.NET Applications
Web Programming Language
Cookies A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer.
Presentation transcript:

CIS 451: ASP Sessions and Applications Dr. Ralph D. Westfall January, 2009

State Handling http server only processes requests for web pages, images, etc. this is a "stateless" connection server sends page, etc. and writes some tracking data to a log file but does NOT store any information in its memory about the request

State Handling - 2 ASP.NET can store some information in memory in relation to web site visitors, which can be used to: make frequently used/updated information available to several/all pages in site store information about a page so it will be available when page is loaded again pass information between pages

Definitions Application: group of web pages working together for a common purpose often in same directory or its subdirectories Session: a client accessing an application Cookie: data stored by the application on a client's computer

Session State session starts when a user accesses a page ends after a time period, or when closed by ASP code data can be stored in "session variables" stored in Session Contents collection available until session ends, then lost user's browser must accept cookies without cookies, can't use session variables

Accessing Contents Collection session contents "indexed" by "keys" writing to Session contents: Session("intCount") = intCount reading from Session contents: intNumber = Session("intCount") variable name before = does NOT have to match names of keys when reading or writing using same names can help in maintenance

Session Object Properties SessionID: unique identifier for session Timeout : when session ends if no activity (default often is 20 minutes) Session.Timeout = 30 'ends 30 minutes international settings (currency)currency CodePage (sets character alphabet) LCID (locale ID values set time zone and other location information, but only if installed on server)

Session Object Methods Abandon: ends session before it times out Session.Abandon() removing Session contents data Session.Clear()

Problem with Session Variables user's browser must accept cookies without cookies, can't use session variables alternative: userID and password requires customer to establish an account data stored in database on server requires writing extra HTML code into each page (hidden form fields) to identify the user who is requesting another page

Application State includes variables that can be available to all pages in the "application" variables can be set/changed from a web page via authorized inputs can also be stored in a Global.asax file value loads into memory every time server is turned on (but changing a value(s) in memory does NOT update this file)

An Application includes all files in a virtual directory ("root"), and in its subdirectories starts when first client opens any of files can have many sessions (users) accessing it at the same time (simultaneously) number of sessions limited only by available memory of server

An Application - 2 continues until server shuts down usually means something went wrong also ends when application is "unloaded" from server can use Microsoft Management Console to unload

Application State Items are stored data useable in all sessions stored in Application Contents collection "initialized" in Global.asax file (can view in Visual Studio) in application's root directory Sub Application_Start(ByVal sender _ As Object, ByVal e As EventArgs) Application("dblPrice1") = 1.50 Application("dblPrice2") = 2.75 End Sub

Accessing Application State Items reading is like reading Session variables dblPrice(1)= Application("dblPrice1") writing requires "concurrency control" Application.Lock() Application("hits") += 1 Application.Unlock() lock so other users can't access until done writing overrides values in Global.asax file does NOT change contents of Global.asax

Global.asax and Web.config Global.asax: settings that won't change use Web.config file for anything that could change instead of Global.asax can store objects as well as variables e.g., connection string connection string if either file has a lot of items, check code to avoid duplications in other files