hi, i want to create a cart in my site and i want the system gives an automatically sessionID to each user who uses the cart. <html> <head> <% VarsessionID=session.SessionID %> </head> <body> <% sqladdtocart="INSERT INTO cart (sessionid,product_id,price ) VALUES ( '"&Varsessionid&"','"&prod_id&"','"&price&"',)" Con.Execute sqladdtocart %></body> </html> HTML: this is my ASP code. all is working fine except of sessionId. i want this sessionID to expire after one hour.
If you're writing ASP, why did you put this question in PHP forum? Report it to moderator and let him move it in the ASP forum.
may be this user defined function will help you private function startSession($time = 3600, $ses = 'MYSES') { session_set_cookie_params($time); session_name($ses); session_start(); // Reset the expiration time upon every page load if (isset($_COOKIE[$ses])) setcookie($ses, $_COOKIE[$ses], time() + $time, "/"); } Code (markup):