|
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 under H301 - PHP - Sticky fields and session [3540] Easy session example in PHP - keeping each customers data apart - (2011-12-06) [2738] What is all this SESSION stuff about? (PHP) - (2010-04-25) [2416] Automating access to a page obscured behind a holding page - (2009-09-23) [1911] Remember Me - PHP - (2008-11-28) [1766] Diagrams to show you how - Tomcat, Java, PHP - (2008-08-22)
Some other Articles
First class functions in Lua lead to powerful OO facilitiesLua - Table elements v table as a wholeAge ConcernVertical LondonBath, Snake or Nag?Clean code, jump free (Example in Lua)Rules, suggestions, considerations for Lua variable namesCurrent visitors from around the world - PHPFinding words and work boundaries (MySQL, Perl, PHP)All around the world?
|
3603 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 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).
|
|