Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
For 2021 - online Python 3 training - see ((here)).

Our plans were to retire in summer 2020 and see the world, but Coronavirus has lead us into a lot of lockdown programming in Python 3 and PHP 7.
We can now offer tailored online training - small groups, real tutors - works really well for groups of 4 to 14 delegates. Anywhere in the world; course language English.

Please ask about private 'maintenance' training for Python 2, Tcl, Perl, PHP, Lua, etc.
Bath, Snake or Nag?

If you're running a web application through a number of phases , you've a choice of three ways of keeping information from one page to the next (keywords - sessions, shopping carts!).

You can use a bathtub - each time history (data) is entered, it gets added to a collection which gets passed back and forth every time between the browser and the server, until you can have a lot of data sloshing around, rather like you have with water in a bath if you move, ever so gently, up and down at the same speed as the natural motion of the waves; a series of small movements lead to some quite dramatic larger movements.

A snake is a single piece of information being passed back and forth - I could use the analogy of the ball in a tennis rally if you prefer - and that piece of information is a unique identifier which gives a key into a database or a file name on the server.

And a nag is someone - a browser - who keep coming back with "it's me again".

Let me translate each of those into a technology / protocol method. The Bathtub is hidden fields, the snake is a single hidden field with data being stored on the server in a session, and the nag is a cookie based session. The problem with a snake or a tennis rally is that once you've broken it, you can't get back and carry on with same rally or reptile so in web terms, you can't break away from a series of pages and then come back and expect to carry on - you have to start anew. And since the Bath is based on the snake, this limitation applies there too.

Which leave you with the "nag" - the cookie. Now we sometimes get a bit short with a nag, just like we're sometimes less that thrilled to accept certain cookies - but nagging can be a very effective way of getting things done, can't it?
(written 2008-08-06, updated 2008-08-07)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
H301 - PHP - Sticky fields and session
  [1766] Diagrams to show you how - Tomcat, Java, PHP - (2008-08-22)
  [1911] Remember Me - PHP - (2008-11-28)
  [2416] Automating access to a page obscured behind a holding page - (2009-09-23)
  [2738] What is all this SESSION stuff about? (PHP) - (2010-04-25)
  [3540] Easy session example in PHP - keeping each customers data apart - (2011-12-06)
  [3820] PHP sessions - a best practice teaching example - (2012-07-27)
  [3918] Multiple page web applications - maintaining state - PHP - (2012-11-10)
  [4070] Passing variable between PHP pages - hidden fields, cookies and sessions - (2013-04-26)


Back to
Clean code, jump free (Example in Lua)
Previous and next
or
Horse's mouth home
Forward to
Vertical London
Some other Articles
First class functions in Lua lead to powerful OO facilities
Lua - Table elements v table as a whole
Age Concern
Vertical London
Bath, Snake or Nag?
Clean code, jump free (Example in Lua)
Rules, suggestions, considerations for Lua variable names
Current visitors from around the world - PHP
Finding words and work boundaries (MySQL, Perl, PHP)
All around the world?
4759 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2021: 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/1739_Bat ... -Nag-.html • PAGE BUILT: Sun Oct 11 16:07:41 2020 • BUILD SYSTEM: JelliaJamb