php


setcookie does not work


I have a simple file called index.php. I need to pass it a querystring that will be stored inside a never-expiring cookie. The file looks exactly like this :
<?php
if (isset($_GET['referrer_id']))
{
$querystringWithJunk = $_GET['referrer_id'];
$querystringArray = explode('/', $querystringWithJunk);
setcookie("referrer_id", $querystringArray[0], time() + 60*60*24*365*100);
}?>
However, no cookie is set. What is inside referrer_id is a simple integer (in the tests I made, it's 1). Function setCoookie return true and everything seems to works fine but no cookie is set. Am I doing something wrong?
Time is bigger than int, so I think result is negative, and then cookie is set into past, what means, it is deleted. Set time to 3 years instead of 100.

Related Links

Cannot re-assign $this?
Yoast breadcrumb plugin showing 1
How to wrap element with another element with php
Using PHP as a Backend with Ember.js
Using array from header in another page
How to detect hashed password length? [closed]
Add data to multiple data fields
How to destroy the APC cache in YII
.val() not capturing the textbox value when button is clicked
PHP calling in more than 1 Tweet
PHPExcel - How to apply borders to dynamic range of cells loaded from mysql data
CodeIgniter Active record update not working
Creating MySQL leaderboard
JSON_BIGINT_AS_STRING removed in php 5.5?
Calling a Model Function in View?
PHP Regex: Extracting content from piped curly braces

Categories

HOME
events
list
scroll
nsis
tcp
cryptography
biztalk-2010
tfs2010
fireloop
sap-fiori
phpstorm-2017.1
spring-amqp
mailmerge
jquery-file-upload
uima
raml
workday
pymongo
substring
quartz.net
offline-caching
msdeploy
running-object-table
history.js
sendmessage
cube
openbr
jsonresult
nic
john-the-ripper
appcode
extbase
flipkart
apache-toree
zend-form
jenkins-slave
roracle
uiautomatorviewer
phppgadmin
sonatype
android-sharing
palindrome
asp.net-web-api-routing
mobile-angular-ui
dblink
emacs25
email-injection
yargs
libharu
xmlbeans
uibinder
simian
fdt
persistent-object-store
management-studio-express
in-app-billing
decidable
arbre
gql
ngcordova
componentart
phpredis
quercus
innerhtml
sablecc
debug-symbols
fasterxml
famo.us
n-tier-architecture
utf8-decode
igor
aho-corasick
progress-db
lru
chefspec
session-0-isolation
cyrillic
jsplitpane
idispatch
stretch
struts2-s2hibernate
dynamic-c
rational-unified-process
subtext
word-automation

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App