• PHP Video Tutorials

PHP - Function setrawcookie



Syntax

bool setrawcookie ( string $name [, string $value [, int $expire = 0 
   [, string $path [, string $domain [, bool $secure = false [, 
   bool $httponly = false ]]]]]] )

Definition and Usage

It used to set the cookies

Return Values

It returns true on success or else false on failure

Parameters

Sr.No Parameters & Description
1

name

It contains Name of the cookies.

2

value

It contains the port number.

3

errno

It contains the information about cookies values.

4

expire

It contains expire time information about cookies

5

path

It contains the information about cookies path wherein server.

6

domain

It contains domain information.

Example

Try out following example

<?php
   setrawcookie('cookie_name', rawurlencode($value), time()+60*60*24*365); 
?>
php_function_reference.htm
Advertisements