Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.

Thread: 

PHP set cookie?

Tags: None
Ads
banner
banner
letsplay Offline referral

Posts: 274
Joined: Jul 2013
Reputation: 1

#1
Senior Member
How to set a cookie with PHP that will have name and expiration date?
marcus_avrelius Offline referral

Posts: 2,519
Joined: May 2013
Reputation: 102

#2
Support Team
This will set cookie that will expire in 24 hours.
PHP Code:
$value ="mycookie value";
setcookie("MyCookie",$valuetime()+3600*24); 

You can leave value empty if you wish:
PHP Code:
setcookie("MyCookie",""time()+3600*24); 
Rapidsoft technologies Offline referral

Posts: 224
Joined: Sep 2015
Reputation: 1

#3
Member
there are few other techniques to set cookie by code.
inder Offline referral

Posts: 12
Joined: Feb 2016
Reputation: 0

#4
Junior Member
To view or modify cookies settings, follow these steps:
In Internet Explorer, click Internet Options on the Tools menu, and then click the Security tab.
Click the Web content zone you want, and then click Custom Level.
Under Cookies, click the options you want, click OK, and then click OK.
damponting44 Offline referral

Posts: 413
Joined: Oct 2016
Reputation: 0

#5
Senior Member
setcookie() characterizes a treat to be sent alongside whatever is left of the HTTP headers. Like different headers, treats must be sent before any yield from your content (this is a convention limitation). This requires you put calls to this capacity before any yield, including <html> and <head> labels and additionally any whitespace.





User(s) browsing this thread: 1 Guest(s)