You are here

secure_cookie_data.module in Secure Cookie Data 7.2

Same filename and directory in other branches
  1. 7 secure_cookie_data.module

secure_data_cookie.module @author António P. P. Almeida <appa@perusio.net> @date Thu Nov 21 11:45:23 2013

@brief Implements the secure cookie protocol for storing data.

File

secure_cookie_data.module
View source
<?php

/**
 * @file   secure_data_cookie.module
 * @author António P. P. Almeida <appa@perusio.net>
 * @date   Thu Nov 21 11:45:23 2013
 *
 * @brief  Implements the secure cookie protocol for storing data.
 *
 *
 */

/**
 * Sets the secure cookie with the given data.
 *
 *
 * @param string $data
 *   The JSON data to be stored in the cookie.
 * @return boolean
 *   TRUE if the cookie was modified/set, FALSE if not.
 */
function secure_cookie_data_put($data) {
  return secureCookieBasic::set($data);
}

/**
 * Obtain the data stored in a secure cookie.
 *
 * @return object
 *   The stored data or NULL if the cookie is missing
 *   or the HMAC doesn't validate.
 */
function secure_cookie_data_get() {
  return secureCookieBasic::get();
}

/**
 * Deletes the cookie.
 *
 * @return boolean
 *   TRUE if the cookie to be deleted exists, FALSE if not.
 */
function secure_cookie_data_delete() {
  return secureCookieBasic::delete();
}

Functions

Namesort descending Description
secure_cookie_data_delete Deletes the cookie.
secure_cookie_data_get Obtain the data stored in a secure cookie.
secure_cookie_data_put Sets the secure cookie with the given data.