Posts

Showing posts from February, 2023

Web development tips (sessions)

Image
  " Always remember to unset your sessions after creating them. Too many unresolved sessions could lead to unplanned system behaviour. " (Mark Anthony Graham) A bit about sessions A session is  a way to store information (in variables) to be used across multiple pages . Unlike a cookie, the information is not stored on the users computer. Sessions in PHP sample code //php add/set session syntax // start a session session _ start (); // store a value in a session $ _ S ESSION [' name '] = ' Mark '; // ret rieve a value from a session echo $_ S ESSION [' name ' ]; // output s ' Mark ' //un set session in php syntax // un set a single session variable un set ($ _ S ESSION [' Mark '] ); // destroy the session session _ destroy (); Sessions in Python sample code #In Python , the syntax for creating a session is as follows : # Import the necessary modules import requests fr

followers