View Single Post
  #56  
Old 04-21-2008, 09:10 AM
 
Nadeem Nadeem is offline
 

Advanced Member
  
Join Date: Sep 2006
Posts: 56
 

Default Re: Making it so they don't have to re-login everytime

Quote:
Originally Posted by virtual@croatia
I know that I'm taking you money out but I'm more for the open source whenever we talk about small programs or projects. For the 4.1 version users just make this simple change:
In auth.php (in the root) find the line

PHP Code:
include_once $xcart_dir."/init.php"

and change it with

PHP Code:
#
# If the user has been here in the last 6 month, extract the session ID from a cookie
#
if (!empty($HTTP_COOKIE_VARS["xsessionid"]))
    
$HTTP_POST_VARS["xid"] = $HTTP_COOKIE_VARS["xsessionid"];

include_once 
$xcart_dir."/init.php";

#
# Keep user session ID in a cookie for 6 months
#
if (empty($HTTP_COOKIE_VARS["xsessionid"]) && !empty($XCARTSESSID))
    @
setcookie("xsessionid"$XCARTSESSIDtime()+3600*24*180); 


This will keep the user session id for 6 months and everyone who has been logged in will be remembered during that period. What is even more important, anonymous users cart will stay remain. I'm currently work on the wishlist to allow anonymous users to use it without registration (without pain in the ass).

Best regards,
virtual@croatia

thanks alot, i was looking for this..
__________________
X-Cart 4.4.5 | Linux/Apache | PHP 5.2.17 | MySQL 5.0.77 | FireFox
Reply With Quote