Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Cookies and variables.. Can anyone help?

Featured Replies

I'm in the process of trying to convert Mason Miller's shopping cart for lasso 3.5/3.6 to lasso 7.

I'm allmost there, but I'm having trouble getting the sessionid generated by the lasso page to work.

I can add items to the database but they do not get any entry into the sessionid field..

And this is needed to use the data later. Would like any help...

I'm going to make the files and databases public if I can get them to work....

At the start of the shoppingcart page is this code (I have changed the value of the variable SessionID from a random number to a fixed value - trying to minimize possible errors).....

[if: (Cookie:'SessionID')='']

[variable: 'SessionID'='abcdefg']

[cookie_set: 'SessionID'=(variable: 'SessionID')]

[else]

[variable: 'SessionID'=(cookie:'SessionID')]

[/if]

Later on the same page is the code to add an item to the shopping cart. This works fine but I don't get any value send to the database field SessionID

[inline: -database='shoppingcart', -table='additem', 'SKU'=(Action_Param: 'SKU'), 'SessionID'=(variable: 'SessionID'), 'Item_Qty'='1', -add]

[/inline]

If I change the code (see below) so that SessionID is set to a fixed value this works and I get a value send to the database field SessionID

[inline: -database='shoppingcart', -table='additem', 'SKU'=(Action_Param: 'SKU'), 'SessionID'='1234567', 'Item_Qty'='1', -add]

[/inline]

So it looks to me like the problem is in the code that sets the cookie and the variable SessionID or they way I'm getting the value when adding an item

Any help would be great... It's driving me nutts.....

  • 2 weeks later...

Hi, Dog! I don't use Lasso but in CDML, INLINEs used to execute and resolve prior to any other code on your page. My guess is that you are calling on SessionID before it has been defined even though you have it higher in the page, it does not get read until the INLINE concludes if my assumption on the INLINE resolving first is correct.

Can you set SessionID=(cookie:'SessionID') instead?

Good luck!

--ST

Hi, Dog! I don't use Lasso but in CDML, INLINEs used to execute and resolve prior to any other code on your page. My guess is that you are calling on SessionID before it has been defined even though you have it higher in the page, it does not get read until the INLINE concludes if my assumption on the INLINE resolving first is correct.

Can you set SessionID=(cookie:'SessionID') instead?

Good luck!

--ST

Hi, Dog! I don't use Lasso but in CDML, INLINEs used to execute and resolve prior to any other code on your page. My guess is that you are calling on SessionID before it has been defined even though you have it higher in the page, it does not get read until the INLINE concludes if my assumption on the INLINE resolving first is correct.

Can you set SessionID=(cookie:'SessionID') instead?

Good luck!

--ST

Oh, BTW... I think in CDML INLINEs also had to resolve alone, i.e. without using any other data or variables. They were like little independent actions that started and resolved like separate pages but could display on the same page (no cross-over of data or variables, though).

I could be wrong, but that's what I think I remember. Hope you get it!

--ST

Oh, BTW... I think in CDML INLINEs also had to resolve alone, i.e. without using any other data or variables. They were like little independent actions that started and resolved like separate pages but could display on the same page (no cross-over of data or variables, though).

I could be wrong, but that's what I think I remember. Hope you get it!

--ST

Oh, BTW... I think in CDML INLINEs also had to resolve alone, i.e. without using any other data or variables. They were like little independent actions that started and resolved like separate pages but could display on the same page (no cross-over of data or variables, though).

I could be wrong, but that's what I think I remember. Hope you get it!

--ST

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.