Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How To Save User Logins And Retrieve It On Next Visit Rate Topic   - - - - -

 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 351 posts

Posted 14 October 2020 - 12:19 PM #1

how to save logins to database and retrieve it on next visit?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22386 posts

Posted 14 October 2020 - 01:14 PM #2

It is not clear what do you mean. Please clarify in more details


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 351 posts

Posted 16 October 2020 - 07:59 PM #3

I'm looking for a way to let users save their login details so they don't have to enter it on next visit



 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3987 posts

Posted 17 October 2020 - 09:37 AM #4

Can only be done via the user's browser.  How would you associate the user with their account?



 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 351 posts

Posted 18 October 2020 - 10:40 PM #5

I'm able to acheive this with cookie and local storage, but they are too open and can be accessed by anyone using the computer, but i want to save the info in the database or on session



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12119 posts

Posted 19 October 2020 - 07:13 PM #6

You can always encrypt the cookie using a key that is only known within the cart.  I.e. you could use fn_encrypt_text()/fn_decrypt_text() functions on the cookie data.  But note that cookies have a lifetime and many users clear them regularly.  Not sure the benefit outweighs the risk/cost.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 351 posts

Posted 22 October 2020 - 10:03 AM #7

You can always encrypt the cookie using a key that is only known within the cart.  I.e. you could use fn_encrypt_text()/fn_decrypt_text() functions on the cookie data.  But note that cookies have a lifetime and many users clear them regularly.  Not sure the benefit outweighs the risk/cost.

How can i use this to set a cookie please

 

 

Cookies.set('password', fn_encrypt_text());

 

Cookies.get(fn_decrypt_text());

 

I tried it but it's not working this way



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12119 posts

Posted 22 October 2020 - 07:16 PM #8

It appears you are using JS.  The fn_encrypt_text/fn_decripty_text are PHP function.

Suggest you use the PHP methods to set/get the cookie values.  I.e. to set, follow: https://www.php.net/...n.setcookie.php

 

To get, use $_COOKIES['password'] assuming the cookie name is 'password'.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.