X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Making it so they don't have to re-login everytime (https://forum.x-cart.com/showthread.php?t=2752)

ProjectShadow 10-29-2004 12:48 PM

Well I attempted an install of this module in my X-Cart version 3.5.11, but it doesn't work.

I don't know much about cookies so I'm pretty much at a dead end. If anyone has successfully installed this on their 3.5.xx cart I would love to get a fix so that this works.

Thanks,

Adam

Jon 10-29-2004 01:04 PM

As mentioned, I'm working on many things currently, and don't have the time to work on this now, though if there is interest I may create a mod for this in the future. In the meantime, if somebody really wanted this I'd be willing to construct it at an hourly rate.

Jon 02-11-2005 06:08 PM

Took a year, but I finally go to it ;)

Here's the final product.

http://www.websitecm.com/store/customer/product.php?productid=89

phil_ 06-01-2005 03:24 AM

I just ordered this mod and it works great, really good for the returning customer to not have to log in again!

I'd recommend this mod.

Philip.

minorgod 06-01-2005 11:52 AM

Quote:

Originally Posted by Jon
Took a year, but I finally go to it ;)

Here's the final product.

http://www.websitecm.com/store/customer/product.php?productid=89


Any chance you'd share the basic idea of how you built this mod so I can add it to my store? If you give me a brief explanation I can probably code it myself. I've got so much customization on my site, I'd rather build my own version than order the mod.

Jon 06-01-2005 10:43 PM

Set, reset, and read from a cookie ;) The mod will integrate no problem regardless of customization.

minorgod 06-02-2005 08:30 AM

Did you decide to store the password in a cookie or are you using some kind of system to generate a unique token/hash value that can be used to log the user in automatically without their password? The password way is easier, but less secure. I've never built an auto-login system that does it the other (more secure) way, but that's the way I'll probably do it.

Jon 06-02-2005 12:36 PM

I stored an encrypted password in the cookie.

minorgod 06-02-2005 03:01 PM

Gotcha. So you're actually encrypting the user's password, saving as a cookie, then when they come back you pass the cookie and decrypt it. Did you make your own encryption method or did you go with x-cart's text crypt functions.

I could be wrong, but It seems like if you're passing the x-cart encrypted password , you might be opening a bit of a security hole since that would make it easier to guess the salt used by the x-cart crypt function. Just a thought. Anyway, thanks for letting me know how yours works. I will refrain from posting a detailed "how-to" if I do this mod for my store. :wink:

Jon 06-02-2005 03:14 PM

Do you have MSN Messenger?

minorgod 06-03-2005 09:01 AM

Naaaa. I'm not a big fan of instant messengers. There was about a month long period back around 2001 that I used several instant messengers and I ended up getting nothing done because people kept bugging me constantly and I ended up leaving my status set to "away" all the time so I figured, why bother?

Anyway, if you want to talk, just PM me through the forum and I'll be happy to give you my direct e-mail address. During the day, that's almost as good as a messenger client since I respond to all new mail as it comes in.

elabdesigns 06-12-2005 07:15 AM

I have a fresh install of 4.0.13 and I can say that the mod given does not work on this version. If you check the box it doesn't login, if you don't check the box it still doesn't login.

It appears that purchasing this mod will be the only fix. But $74.99 is a hefty price for a small addition.

subzero 04-11-2006 02:17 AM

wont log in without tick box ticked
 
all seems well with this mod except if u dont tick the remember me box it doesnt log anyone in
anyone found how to get round this????

Jon 04-11-2006 08:29 AM

We've lowered the price for Remember Me from $74.99 to $54.99.

http://www.websitecm.com/x-cart-mods/remember-me.html

virtual@croatia 04-21-2008 05:41 AM

Re: Making it so they don't have to re-login everytime
 
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

Edit: Thread was moved to a new thread.

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

Nadeem 04-21-2008 09:10 AM

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.. O:)

imexhouse 04-28-2008 12:12 AM

Re: Making it so they don't have to re-login everytime
 
Will this work for 4.0.x? I realize that there's no init.php in 4.0.x, but other than that, can this be adapted?

Richard Walkling 04-28-2008 01:30 AM

Re: Making it so they don't have to re-login everytime
 
I added this to our cart on Friday - and had a number of reports over the weekend that Add tocart buttons were not working - NEVER had this problem before and this was the only change - so I have removed it.

v.4.1.8
php 5.1.6
mysql 5.0.22

#
# 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", $XCARTSESSID, time()+3600*24*180);

virtual@croatia 04-28-2008 01:55 AM

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

Originally Posted by Richard Walkling
I added this to our cart on Friday - and had a number of reports over the weekend that Add to cart buttons were not working - NEVER had this problem before and this was the only change - so I have removed it.


I'm really sorry that you had problems with it. It's the first version of the code and sometimes it simply doesn't work from the first shot. I've opened a new thread
with new version of the code. This version corrects an error which I've found (maybe is the one you had, maybe not).

virtual@croatia 04-28-2008 02:01 AM

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

Originally Posted by imexhouse
Will this work for 4.0.x? I realize that there's no init.php in 4.0.x, but other than that, can this be adapted?


I don't have 4.0 version so I don't know. You should try it on a testing server to see if it works.

imexhouse 04-28-2008 07:05 AM

Re: Making it so they don't have to re-login everytime
 
I've compared the init.php from 4.1.8 to config.php from 4.0.19, and most of init.php is incorporated into the 4.0.x. config.php
There's a line in 4.0.19 auth.php:

include_once $xcart_dir."/config.php";

I'll try to plug your code around that line and see what happens.

virtual@croatia 04-28-2008 07:32 AM

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

Originally Posted by imexhouse
I've compared the init.php from 4.1.8 to config.php from 4.0.19, and most of init.php is incorporated into the 4.0.x. config.php
There's a line in 4.0.19 auth.php:

include_once $xcart_dir."/config.php";

I'll try to plug your code around that line and see what happens.


I've opened a new thread with a new version of the code. Could you please post results to there?

Best regards,
virtual@croatia

imexhouse 04-28-2008 07:55 AM

Re: Making it so they don't have to re-login everytime
 
OK
I'll ask my questions at the new thread...


All times are GMT -8. The time now is 08:50 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.