-
Notifications
You must be signed in to change notification settings - Fork 1
Cookie
The Cookie utility allows to easily read and write browser cookies. The class for the utility is named Cookie
and part of the Core
module.
This utility is only useful when the client sending the request supports client-side cookies. It is not advisable to rely on cookie on API calls.
To access the configuration utility, you must import the Cookie
class from the Core
module.
use Apine\Core\Cookie;
The class only contains static methods. It is not necessary to instanciate the class. You can directly call its methods.
To read a cookie, use the get
method.
$value = Cookie::get('cookie_name');
To write a value to a cookie, use the set
method.
Cookie::set('cookie_name', $value);
Read the value of a cookie.
Its only parameter is the name of the cookie to read. The method returns the value of the cookie if the cookie exists. It returns nothing if it cannot locate the cookie.
Write a value to a cookie.
This method has two mandatory parameters which are the name and the value of the cookie. The optional parameter is the expiration date of the cookie expressed as an UNIX timestamp. If set to 0, or omitted, the cookie will expire at the end of the session. The method returns TRUE
if it was able to write the cookie or FALSE
if an error occurs.
- Introduction
- Getting Started
- Requirements & Installation
- Application Configuration
- Database Connection
- How to use Controllers
- How to use Views
- How to Manage Session
- How to use the api (Coming Soon)
- Utilities
- Entity Manager
- File Manager
- Access and Save File (Coming Soon)
- Image Methods (Coming Soon)
- XML Manager
- XML Class (Coming Soon)
- Parser (Coming Soon)
- Writer (Coming Soon)
- Advanced Topics
- Extended Users
- Routes
- Templating (Coming Soon)
- Translations and Locales