HTML5 Data Bindings Support Product Page

Answered

Use a session variable as a filter

Asked 15 Mar 2015 21:38:03
3
have this question
15 Mar 2015 21:38:03 Chuck Borrelli posted:
I am confused... In this topic, you had said that the data bindings CANNOT read session variable...

www.dmxzone.com/support/21863/topic/59822

BUT there is clearly an option to CHOOSE session variable in the filter tab of the data source query builder.

Was I misled when I purchased this, or is there a way to read session variables as the menu implies?

Replies

Replied 16 Mar 2015 10:22:48
16 Mar 2015 10:22:48 Teodor Kuduschiev replied:
Hi Chuck,
Of course you can filter your data using Session Variable, as well as Form Variable, Url Paramater etc...
Just enter the condition and then add your session variable name:

FULL SIZE
Replied 16 Jan 2016 15:51:22
16 Jan 2016 15:51:22 Guy Krzanowski replied:
This does not clearly address my issue. I am trying to display user name based off of the logged in session. for example when a user logs in they get a message on the top of the page that welcomes them. "Welcome Dave" currently i have the string <?php echo $_SESSION['dbDashboard_id'];?> but it keeps returning the value "Welcome 4". I viewed this topic but it does not explain how to return a user column value from the logged in user. One response I had was "Each data set can be filtered based on a session variable. So open the data set you use to get the User details, and set it with a filter based on the id and Session Variable with name of dbDashboard_id. That will filter the data set to get the exact user details. " I have tried this and it does not work. mostly because it is vague or to simple that it seams to miss steps or assumes we know more that what we do. I am looking for a video or "step by step" that shows how to return a value from a column from the database that is based off the logged in session. I have reached out to the support department and keep getting the same person. I don't know how much help they have been because one comment he made was "I am getting tired of this" I am just trying to use the extensions to do some basic things that were easy in the deprecated dw behaviors.
Replied 19 Jan 2016 02:15:51
19 Jan 2016 02:15:51 Tyler Harvey replied:
Is anyone going to respond to this? I am also trying to use the session variable of the user Id to filter down user data for display on a page. (Ie. my query pulls first_name and last_name with a filter of the session variable that contains the ID for current user). It simply does not work. If I set a default to a known user Id it pulls back in testing just fine.
Replied 19 Jan 2016 18:20:49
19 Jan 2016 18:20:49 Brad Lawryk replied:
It used to be that you could filter the user by using the session variable 'dmxSecurityId' but that no longer seems to work. I have been t trying to get it to work for two days now.

Did something change?
Replied 19 Jan 2016 21:53:31
19 Jan 2016 21:53:31 Tyler Harvey replied:
I figured it out. The documentation is horrible. If you go to your login action and find the name of the security provider (look for the Security Provider step and notice the name after "Security Provider: ". Then, simply call the variable by TheName_id.

For example, my security provider is named dmxSiteSecurity, so my session variable is dmxSiteSecurity_id.
Replied 19 Jan 2016 22:04:41
19 Jan 2016 22:04:41 Brad Lawryk replied:
Thank you so much for your time, Tyler.

So my Security Provider is called simply 'userLogin'. So I tried filtering my recordset by the session variable 'userLogin_id' but that didn't work. Was the 'id' portion of that variable a db field name you have set?
Replied 19 Jan 2016 22:07:48
19 Jan 2016 22:07:48 Tyler Harvey replied:
That should be correct.

To debug, try adding the following code somewhere in your page and load in the browser to see a dump of what is held within the $_SESSION array. If you receive an error back, make sure that you have an executor on that page. If you get array data back, then take a look and see if you have any session variables that contain the user id.

<?php
echo "<pre>";
var_dump($_SESSION);
echo "</pre>";
?>
Replied 19 Jan 2016 22:15:20
19 Jan 2016 22:15:20 Brad Lawryk replied:
Thank you so much! I now have it working. DMX should hire you. I could buy you a nice cold beer right about now!

Such powerful tools with so little support and documentation.

I thank you again. So much appreciated!
Replied 19 Jan 2016 22:18:06
19 Jan 2016 22:18:06 Tyler Harvey replied:
Ha! Anything I can do to help. It took me two days to get mine working with the lack of docs. Miro from DMX helped point in the right direction this morning.
Replied 20 Jan 2016 08:04:11
20 Jan 2016 08:04:11 Teodor Kuduschiev replied:
Hello all,

We are in a process of updating the HTML5 Data Bindings, Server Connect and Security Provider. This will generate a new session variable name, that's why the old dmxSecurityId won't be available.
That is also the reason for the documentation to not be up to date yet.

I'm really sorry for the delayed updates, our developers are doing their best to provide them as soon as possible. Please do send an email to George Petrov: about this and let him know what troubles this causes to you all. Your feedback is important and appreciated.
Replied 25 Mar 2016 16:56:42
25 Mar 2016 16:56:42 Guy Krzanowski replied:
has the documentation or video been updated on this, still can get it to display user name instead of id
Replied 25 Mar 2016 17:45:23
25 Mar 2016 17:45:23 Teodor Kuduschiev replied:

Reply to this topic