• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to create a cookie to store the timestamp of when a page is first loaded with php

phpcookiestimestamp


PHP Snippet 1:

if (!isset($_COOKIE['load_date'])) {
    setcookie('load_date', time(), time() + 86400*365);
}

Related Snippets

Unable to guess the mime type as no guessers are available Laravel 5.2

Log file is not being written in Laravel 5.5

Laravel 5 session not persisting after user is logged in

How to Generate PDF invoice to XML format using mPDF

Cross-Origin Resource Sharing (CORS) witth Laravel and Vuejs

WAMP Virtual Host not working

Laravel lang slug in url

Laravel 5.2: Unable to locate factory with name [default]

oauth-private.key does not exist or is not readable

Sentry on Symfony: how to exclude `NotFoundHttpException`

mysql slow on updates for a well optimized query

Dropzone: Submit both form data and dropzone at once

500 Internal Server Error on Ajax request. Not sure the origin of the problem

display WooCommerce “Add to cart” button with short-code [add_to_cart ] dynamically

Last order would be re-order in wooCommerce. How is it possible?

About Contact Privacy policy Terms and conditions