CIS 451: Cookies Dr. Ralph D. Westfall February, 2009.

Slides:



Advertisements
Similar presentations
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.
Advertisements

CIS101 Introduction to Computing Week 08. Agenda Your questions JavaScript text Resume project HTML Project Six This week online Next class.
CIS 451: ASP Sessions and Applications Dr. Ralph D. Westfall January, 2009.
Tutorial 6 Working with Web Forms
XP Tutorial 9 New Perspectives on JavaScript, Comprehensive1 Working with Cookies Managing Data in a Web Site Using JavaScript Cookies.
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
Session Management A290/A590, Fall /25/2014.
Browser and Basics Tutorial 1. Learn about Web browser software and Web pages The Web is a collection of files that reside on computers, called.
Chapter 10 Maintaining State Information Using Cookies.
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Beginning Active Server Pages Barry Sosinsky Valda Hilley Programming.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Cookies & Sessions.
ASP.NET Dr. Ralph Westfall May, Web Development Problem HTML designed to display static pages only interactive when user clicks links  can’t provide.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
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.
Working with Cookies Managing Data in a Web Site Using JavaScript Cookies* *Check and comply with the current legislation regarding handling cookies.
THE BIG PICTURE. How does JavaScript interact with the browser?
Creating a Web Site to Gather Data and Conduct Research.
State Management. What is State management Why State management ViewState QueryString Cookies.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
Web Programming Language Week 7 Dr. Ken Cosh Security, Sessions & Cookies.
Chapter 8 Cookies And Security JavaScript, Third Edition.
CIS 451: ASP.NET Objects Dr. Ralph D. Westfall January, 2009.
Maintaining State MacDonald Ch. 9 MIS 324 MIS 324 Professor Sandvig Professor Sandvig.
Lecture 8 – Cookies & Sessions SFDV3011 – Advanced Web Development 1.
ASP/ASP.NET: Tricks and Tips How to get Microsoft’s Programming Language to work for you By Wade Tripp Park University
Mark Dixon 1 03 – Passing Data between pages: Forms, Sessions, & Query Strings.
Chapter 6 Server-side Programming: Java Servlets
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
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.
11 1 Cookies CGI/Perl Programming By Diane Zak Objectives In this chapter, you will: Learn the difference between temporary and persistent cookies.
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.
STATE MANAGEMENT.  Web Applications are based on stateless HTTP protocol which does not retain any information about user requests  The concept of state.
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
COOKIES and SESSIONS. 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.
ASP.Net, Web Forms and Web Controls 1 Outline Session Tracking Cookies Session Tracking with HttpSessionState.
ITM © Port, Kazman1 ITM 352 More on Forms Processing.
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.
Cookies COEN 351 E-commerce Security. Client / Session Identification HTTP Headers Client IP Address HTTP User Login FAT URLs Cookies.
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
XP Browser and Basics COM111 Introduction to Computer Applications.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
1 State and Session Management HTTP is a stateless protocol – it has no memory of prior connections and cannot distinguish one request from another. The.
IS2802 Introduction to Multimedia Applications for Business Lecture 8: JavaScript and Cookies Rob Gleasure
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.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Project 6: Creating XHTML Forms Kelly.
ASP.NET Part II Dr. Awad Khalil Computer Science Department AUC.
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.
Working with ASP.NET Controls What is ASP.NET Using server controls in your pages Allowing users to create their own accounts Creating a login page Letting.
PHP: Further Skills 02 By Trevor Adams. Topics covered Persistence What is it? Why do we need it? Basic Persistence Hidden form fields Query strings Cookies.
Unit 4 Working with data. Form Element HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes, radio-buttons,
Distributed Web Systems Cookies and Session Tracking Lecturer Department University.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
Y.-H. Chen International College Ming-Chuan University Fall, 2004
Cookies BIS1523 – Lecture 23.
HTML5 and Local Storage.
Building ASP.NET Applications
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.
MIS 3200 – Unit 6.1 Moving between pages by redirecting
Presentation transcript:

CIS 451: Cookies Dr. Ralph D. Westfall February, 2009

Problem server mostly tracks requests for files very efficient for high volume of users memory doesn't know who is asking for files even if from link on file in same web site to help server, could send identification identification needs to associated with all files requested by same user of application use HTML "hidden fields" in later pages?

Possible Solutions password login (+ hidden fields) advantage: highest security disadvantage: extra work for customer automated identification (+ hidden) could generate a random # to ID customer advantage: no extra work for customer disadvantage: only good for one session can' track repeat visits by same person

Another Solution: Cookies information stored in file on client computer National Semiconductor cookies policycookies policy advantages user only needs to enter data one time data "persists," so it is available in later sessions disadvantages some users won't allow cookies (very few?) cookies can be removed from user's computer expire, replaced by newer ones, or cleared by user

Cookies cookies have names a cookie can have multiple values cookie data accessed by the cookie's name (and by the keys if more than one value) cookies are part of both the Request and Response ASP intrinsic objects created by Response.Cookies methods stored in Request.Cookies "collection"

Working with Cookies creating Response.Cookies("cookie")("key") = "value" 'substitute "literals" or string variables for 'items within " " 'note similarities to selection of multiple 'items in a ListBox on HTML or.NET form deleting Response.Cache.SetExpires _ 'line continuation (DateTime.Now.AddDays(-5))'positive or negative 'negative value deletes on client 'but session still has data

Using QueryString in an aspx File can create the same effect sending from an aspx file as from a html file Response.Redirect("rsp.aspx?Name=" & _ this.txtName.Text & "&LastName=" & _ this.txtLastName.Text) values are URL encoded and visible in browser address of destination page one way to migrate from html to aspx

Working with Cookies - 2 accessing strValue = Request.Cookies("cookie")("key") 'note that data is accessed from Request object counting cookies intCount = Request.Cookies.Count + 1 '0 based: need to add 1 to get actual #

Viewing Cookies install Web Developer add-on for Firefox Cookies>View Cookie Information

Cookie Exercise create a web project in VB.NET add one TextBox and a Button to the Default.aspx form add another form named CookieRead.aspx and add a Label to it

Cookie Exercise - 2 double-click on each form to create the aspx.vb code-behind files or right-click on the file names in Solution Explorer>View Code download cookiewrite.aspx and cookieread.aspx from Code Samplescookiewrite.aspx cookieread.aspx use the code examples to get the two pages to run

Cookie Exercise - 3 make enhancements add some more input fields to Default.aspx and modify CookieRead.aspx to output these new fields add a Button to reset TextBoxes to blanks rather than reloading cookie values add Button to 2 nd page to delete cookie