session_start(); $session = OW::getSession(); $session->set("username", "john.doe"); $username = $session->get("username"); echo "Welcome, " . $username;
$session = OW::getSession(); $session->delete("cart");In this example, the getSession function is used to retrieve the current user's session object, which is then used to delete the contents of the user's shopping cart. The OW prefix in both examples suggests that the code is using the Oxwall framework and its standard libraries. The getSession function is part of the OWSession class, which is included in the OW core package.