• 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

XAMPP keeps showing Dashboard/Welcome Page instead of the Configuration Page

Laravel: Why is my variable not being set while it's in the construct function of the controller?

Python - Include another Python script

Match single unknown parameter php (Morse-code Regex)

GA4 custom event from server side, can someone tell me how i can do the following code in php?

The difference when using if statement true === something() vs something() === true [duplicate]

How can I format this number correctly using PHP?

PHP: How to solve ob_start() in combination imagepng() issue?

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

Upload a file Using PHP and JavaScript

PHP my timezone is no setting up in PHP.ini File in xampp

Display a success custom notice after Placing an Order in WooCommerce

OAuth2 Token PHP

Get image type from base64 encoded src string

Yii2: How to download backup files using spanjeta/yii2-backup?

About Contact Privacy policy Terms and conditions