• 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

Facebook API, get page post link (PHP)

Symfony there are no commands defined in the "make" namespace

httpd.conf on Windows: can't locate API model structure `php8_module`

Unit (real unit test) of test laravel relationship

Check for PDO Results, If None Display Message, If Yes then Loop Through

PHP, how to convert Int value to Week days

Edit product hook WooCommerce

Failed user login on production server using Symfony framework (Authentication request could not be processed due to...)

WooCommerce Additional Information - if empty, hide

Laravel s3 upload file with metadata using pre-signed url

Is there a way to use Foundry Model for Authentification inside Functional Tests?

Eloquent insert id with sequence next value

Execute only one time and then wait set period of time before executing again

How to set time with DateTime modify?

Explain how this array transposing and flattening function works

About Contact Privacy policy Terms and conditions