{"id":1238,"date":"2018-01-19T19:22:36","date_gmt":"2018-01-19T19:22:36","guid":{"rendered":"http:\/\/goofy-trucks.flywheelsites.com\/best-practices-sessions\/"},"modified":"2018-01-19T19:24:38","modified_gmt":"2018-01-19T19:24:38","slug":"best-practices-sessions","status":"publish","type":"post","link":"https:\/\/phpbuilder.com\/best-practices-sessions\/","title":{"rendered":"Best practices: Sessions"},"content":{"rendered":"<div class=\"phpbuilder-content\">\n<div class=\"phpbuilder-meta\">\n<div class=\"\">By Paul Booker<\/div>\n<div class=\"\">on August 19, 2002<\/div>\n<\/p><\/div>\n<div id=\"overflow-content\">\n<div class=\"articlePara\">\nIt is the intention of this article to discuss and generate further debate surrounding best practices<br \/>\nin developing database driven, session orientated dynamic websites and to present some adopted styles<br \/>\nand conventions. The ideas and approaches that are developed here could be realised with almost any<br \/>\ncombination of server side scripting language and relational database.<\/div>\n<div class=\"articlePara\">\nSessions and relational databases both offer the opportunity of storing information server side.<br \/>\nSessions can help to maintain state while you navigate an internet website and relational databases<br \/>\noffer a medium for the permanent storage of information in a logical and consistent manner which<br \/>\nallows for structured queries to be carried out against that stored information.<\/div>\n<div class=\"articlePara\">\nDuring the design process the dilemmas that are often encountered are deciding how information should<br \/>\nbe stored in a database and what information should be registered to the session. <\/div>\n<div class=\"articlePara\">\nWhat I would like to demonstrate now is a framework of cooperation between relational databases and<br \/>\nsessions which is both aesthetically appealing as well as productive this will be done by  examining<br \/>\nfeatures of a secure website.<\/div>\n<div class=\"articlePara\">\n First of all I would like to discuss in simple terms what it means for a table to be  normalised.<br \/>\n A table is considered normalised if information is organised logically without inconsistencies and<br \/>\n there is  minimal redundancy an example will help to demonstrate.<\/div>\n<div class=\"articlePara\">\nConsider the following simple normalised table called security, this  table stores sensitive<br \/>\ninformation  and is queried against to gain authorisation to a secure website.<\/div>\n<div class=\"articlePara\">\n<pre>\n   username     password     access_level  screen_name   security_id\n\n\n   rstallman     r5y8jv5f8      U            richard         1\n\n   billgates     8yc2d42f5      X            bill            2\n\n   linustorvalds h89x35f56      P            linus           3\n\n<\/pre>\n<\/div>\n<div class=\"articlePara\">\nNotice that this security table encapsulates all that is security related there is no redundancy,<br \/>\nthat is no unnecessary repetition and if you had to update a username or a password you have only to<br \/>\nmake a single change somewhere. This is normalisation.Also note that all records here in the security<br \/>\ntable have a unique identifier called security_id this in a important field called a &#8220;primary key&#8221;.<\/div>\n<\/div>\n<p><\/p>\n<div style=\"float: left; padding:15px; color:#17AAF3\">\n<div style=\"background-color:#B6E5FC; font-size:16px; margin-top:1px; padding:1px 4px 1px 4px; color:#000; font-style:bold; float:left;\">1<\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"paul200207294658.html?page=2\">2<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"paul200207299ba9.html?page=3\">3<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"paul20020729fdb0.html?page=4\">4<\/a> <\/div>\n<div style=\"float:left; padding:2px;\"><a class=\"paginationPageLink\" href=\"paul200207294658.html?page=2\">Next Page \u00bb<\/a><\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>It is the intention of this article to discuss best practices in developing database driven, session orientated dynamic websites and to present<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1238","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/comments?post=1238"}],"version-history":[{"count":1,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1238\/revisions"}],"predecessor-version":[{"id":3139,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1238\/revisions\/3139"}],"wp:attachment":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/media?parent=1238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/categories?post=1238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/tags?post=1238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}