Servertec   Cookie Counter Servlet
Content
Introduction
Release Notes
Features
FAQs
Requirements
Installation
Add-ons
How To
Change Log
Future Plans
Knowledge Base
Documentation
Samples
Hello World
Display Arguments
Display Headers
URL Redirect
CGI Tester
SSI Tester
Servlet Tag
Servlet Chaining
Log
Cookie Counter
Cookie Tester
Protected Page
List Employees
Connection Pool
Simple Form
Dump Form
Page Counter
File Upload
Session Tester
Context Tester
Sales
Legal
Feedback

 

This example displays:
cookie counter is count

Where count is the number of times this page was hit since the browser was last started.

Clicking on refresh will cause the page to be redisplayed and the counter to increment.

The counter is stored as a cookie cookiecounter by the client's browser. If the cookie cookiecounter does not exist, then the cookie is initialized to 1.

This example used buffered response output in order to be able to set the cookie value. Cookies must be sent along with the header before any other output is sent to the client's browser.

[ view source ] [ run ]

 top of page
 Built with iScript Copyright © 1997-2000 Servertec. All rights reserved.
Last Modified: Thu Aug 10 13:07:08 EDT 2000