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.

Slides:



Advertisements
Similar presentations
CookiesPHPMay-2007 : [‹#›] Maintaining State in PHP Part I - Cookies.
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.
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
Session 13 Active Server Pages (ASP) Matakuliah: M0114/Web Based Programming Tahun: 2005 Versi: 5.
CIS 451: ASP Sessions and Applications Dr. Ralph D. Westfall January, 2009.
1 Chapter 12 Working With Access 2000 on the Internet.
Client State Management & Application Security  Client State Management  Concept  ASP Examples  Application Security  Database Based Approach 
ASP Cookies Y.-H. Chen International College Ming-Chuan University Fall, 2004.
1 Chapter Overview Creating User and Computer Objects Maintaining User Accounts Creating User Profiles.
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.
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.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Server-side Scripting Powering the webs favourite services.
IT533 Lectures Session Management in ASP.NET. Session Tracking 2 Personalization Personalization makes it possible for e-businesses to communicate effectively.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
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.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
ASP The Global.asa file Y.-H. Chen International College Ming-Chuan University Fall, 2004.
Chapter 8 Cookies And Security JavaScript, Third Edition.
Week seven CIT 354 Internet II. 2 Objectives Database_Driven User Authentication Using Cookies Session Basics Summary Homework and Project 2.
Maintaining State MacDonald Ch. 9 MIS 324 MIS 324 Professor Sandvig Professor Sandvig.
1 Maryland ColdFusion User Group Session Management December 2001 Michael Schuler
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.
Christopher M. Pascucci Basic Structural Concepts of.NET Managing State & Scope.
Session and Cookie Management in.Net Sandeep Kiran Shiva UIN:
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.
Web Database Programming Week 7 Session Management & Authentication.
Cookies and Sessions IDIA 618 Fall 2014 Bridget M. Blodgett.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Lecture Note 8: ASP Including Files and The Global.asa file.
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.
Lecture Note 7: Sessions and Applications Object.
ASP Objects Active Server Pages (cont..) 1. 2 ASP : Objects ASP provides built-in objects for performing useful tasks that simplify web development.
Microsoft FrontPage 2003 Illustrated Complete Integrating a Database with a Web Site.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
SESSIONS 27/2/12 Lecture 8. ? Operator Similar to the if statement but returns a value derived from one of two expressions by a colon. Syntax: (expression)
8 th Semester, Batch 2008 Department of Computer Science SSUET.
 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 requests.
Maintaining State in ASP. Problem - How do I maintain state information about the user  Several Methods –Cookies –Session variables –Hidden fields 
Application Object Controlling the Application Application Object Controlling the Application.
ASP Application Object Y.-H. Chen International College Ming-Chuan University Fall, 2004.
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.
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 3 PHP Advanced.
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.
PHP – Hypertext Preprocessor.
ASP – Web Programming Class  Ravi Anand. ASP – Active Server Pages What is ASP? - Microsoft Technology - Can Run using IIS/PWS/Others - Helps us create.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Development of Internet Application 1501CT - Sara Almudauh
WWW and HTTP King Fahd University of Petroleum & Minerals
Session Variables and Post Back
Y.-H. Chen International College Ming-Chuan University Fall, 2004
ASP Explained By: Sarbjit Kaur.
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.
Cookies and Sessions in PHP
ISC440: Web Programming 2 Server-side Scripting PHP 3
The Request & Response object
ASP.
Chapter 27 WWW and HTTP.
MIS Professor Sandvig MIS 324 Professor Sandvig
Configuring Internet-related services
CSE 154 Lecture 21: Sessions.
Building ASP.NET Applications
CSE 154 Lecture 22: Sessions.
Advanced Concepts and AJAX
PHP-II.
Presentation transcript:

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 requests a page with a browser, it will send the cookie too. With ASP, you can both create and retrieve cookie values How to Create a Cookie? The "Response.Cookies" command is used to create cookies. Response.Cookies(“User”)=“xyz” Note: The Response.Cookies command must appear BEFORE the <html> tag.

Deleting a cookie — physically removing it from the user's hard disk — is a variation on modifying it. You cannot directly remove a cookie because the cookie is on the user's computer. However, you can get the browser to delete the cookie for you. The following command will delete the cookie. Response.Cookies["Hello"].Expires = DateTime.Now.AddDays(-1); Response.Cookies["Hello"].Expires(#May 10,2012#)

Application Object An application on the Web may consists of several ASP files that work together to perform some purpose. The Application object is used to tie these files together. The Application object is used to store and access variables from any page. The Application object holds information that will be used by many pages in the application (like database connection information). The information can be accessed from any page. The information can also be changed in one place, and the changes will automatically be reflected on all pages.

Application Variables Application variables are also available to all pages in one application. Application variables are used to store information about ALL users in one specific application. Application variables can be accessed and changed by any page in an application. You can create Application variables in "Global.asa" like this: <script language="vbscript" runat="server"> Sub Application_OnStart application("vartime")="" application("users")=1 End Sub </script> In the example above we have created two Application variables: "vartime" and "users".

Application Object Collection Description Contents Contains all the items appended to the application through a script command Static objects Contains all the objects appended to the application with the HTML <object> tag

Application object methods Description Contents.Remove Deletes an item from the Contents collection Contents.RemoveAll Deletes all items from the Contents collection Lock Prevents other users from modifying the variables in the Application object Unlock Enables other users to modify the variables in the Application object

Application Events Events Description Application_OnEnd Occurs when all user sessions are over, and the application ends Application_OnStart Occurs before the first new session is created

The Session Object When you are working with an application on your computer, you open it, do some changes and then you close it. This is much like a Session. The computer knows who you are. It knows when you open the application and when you close it. However, on the internet there is one problem: the web server does not know who you are and what you do, because the HTTP address doesn't maintain state.

The Session object stores information about, or change settings for a user session. Variables stored in a Session object hold information about one single user, and are available to all pages in one application. Common information stored in session variables are name, id, and preferences. The server creates a new Session object for each new user, and destroys the Session object when the session expires.

Session Start A session starts when: A new user requests an ASP file, and the Global.asa file includes a Session_OnStart procedure A value is stored in a Session variable A user requests an ASP file, and the Global.asa file uses the <object> tag to instantiate an object with session scope

Session End A session ends if a user has not requested or refreshed a page in the application for a specified period. By default, this is 20 minutes. If you want to set a timeout interval that is shorter or longer than the default, use the Timeout property. The example below sets a timeout interval of 5 minutes: <% Session.Timeout=5 %>

Session Object Methods Session.Contents.Remove(“session_name”) Session.Contents.RemoveAll() Session.Contents.Count()