This script can display a form or the data stored inside cookies depending on whether cookies has been set or not.
The online form is used to send data and store them inside cookies.
The script contains an online example.
PHP has a function setcookie since version 3.0, but this function is too low-level for simple usage.
Function ae_put_cookie provided, sets cookie for current domain without specifying long arguments lists. Just three arguments: 'name', 'value', session cookie flag/number of days/forever cookie flag
You can use this kind of code for user systems to check if a user is logged in or not. This is a very good checking to see if users have logged in or not.
To begin this tutorial in PHP sessions, you must first make sure that your web server (ie. apache) has the options to allow session with the configuration. Note: people using apache and php under a win32 enviorment must manually configure this option.
To start, this tutorial, you should have some basic knowledge of php coding. Refer to Hotscripts for some basic and more advanced php coding tricks.
Cookies enabled web developers to produce more usable sites, by allowing temporary storage of commonly used information by the user. This can be beneficial in shopping carts, user logon systems and general site usage. Read on to find out how to use cookies and how to implement a simple user logon system.
Platform(s): Linux, Windows, FreeBSD, Mac OSX, Sun Solaris
A collection of 19 tips on understanding and using sessions in PHP. Clear explanations and tutorial exercises are provided on starting and closing sessions, saving and retrieving values in sessions, deciding how session IDs to be transferred, deciding where to store session files, deciding when to expire session values, etc. Topics included in this collections:
What Is a Session?
How To Turn On the Session Support?
How To Save/Retrieve Values to the Current Session?
What Is a Session ID?
How To Retrieve the Session ID of the Current Session?
What Are the Options to Transfer Session IDs?
How Session IDs Are Transferred on Your Web Server?
How To Force the PHP Engine to Use Cookies to Transfer Session IDs?
Is It More Secure to Use Cookies to Transfer Session IDs?
Where Are the Session Values Stored?
What Set the Timeout Period on Session Values?
How To Remove Values Saved in the Current Session?
How To Tell If a Session Is New?
What Is session_register()?
Platform(s): Linux, Windows, FreeBSD, Mac OSX, Sun Solaris
For those new to web development and 'how things work', cookies can be a very confusing matter. In this tutorial, Timothy gives you an overview of cookies to help you understand how they work.