Hi, i want to create a shopping cart but i don't know how to set automatically a sessionID for each user that uses the cart. i want my cookie to expires after 1 hour or when the user closes his browser window. can anyone help me? thanks in advance.
Start here: http://php.net/session To set a session: session_start(); This must be before any output. Best to set the session as the very first thing on a page. To get the session id: $session_id = session_id(); You will need to set session.gc_maxlifetime, session.cookie_lifetime in php.ini or .htaccess or at the top of each script to get the sessions to expire in 1 hour.