Cookie to filter query

I have a ‘members only’ website that displays specific query information depending on a cookie that gets set at login.

In Wappler, I am able to setup the query, but can’t figure out how filter on their cookie. Any help would be appreciated.

Thanks,

-Joe

Hi Joe, have you seen this tutorial?

Is there a reason why you need to use a seperate cookie than the one that is already generated?

Hi Brad, I’ll take a look at the tutorial, thanks!

This is a legacy site that already has a login to set the cookie. So I’m just trying to use an existing cookie on the new Wappler page/query.

In your Query under Globals / $_Cookie set your Cookie name by adding a variable with the name you require. Then you can select this Cookie to filter by in your Conditions area.

2019-10-10_20-05-54

3 Likes

Thanks Dave! That’s exactly what I was looking for.

1 Like

No worries @jthrift :slight_smile:

You can also set further Cookies by adding the Cookie Manager to your page and entering variable names to assign to Cookies, for instance setting a Cookie on click using a binding from within a returned data set for example, you would create the new Variable and give it a name, then select it’s value from, lets say, a Repeat or just a result from a query, then filter via this Cookie Variable in your Server Connect Action as required for the next query etc. So on and so fourth.

:slight_smile:

1 Like