App Connect State Management Support Product Page

Answered

Session ID as query

Asked 19 Jan 2018 18:42:55
1
has this question
19 Jan 2018 18:42:55 Dan Everton posted:
hi

I have a login form that sets a user id session value to next page

i want to show more user info that is shared accross pages but without seting more values in a form (which is pointless as part of a login) I cannot see how to do it. Certain its possible but don't know how.

Please help

So to elaborate further is it possible to set a record query based on a session variable so i can bind data from a table based on associated session variable?

Replies

Replied 21 Jan 2018 14:41:48
21 Jan 2018 14:41:48 Teodor Kuduschiev replied:
Hello Dan,
You can use the session variable to filter your database queries - define the session variable name under Globals > Session and in the filters tab use the defined session as a filter value.
Replied 22 Jan 2018 18:01:51
22 Jan 2018 18:01:51 Dan Everton replied:
Hi Teodor

Thanks for this.

I've been trying to do this but it doesn't seem to pull through the variable.

Ideally I want to store the id value from a user login and filter data in on subsequent pages. Whats the best way to achieve this?

Thanks
Dan
Replied 22 Jan 2018 18:29:56
22 Jan 2018 18:29:56 Teodor Kuduschiev replied:
What are you trying exactly and what is it not pulling?
To store user id in a session just use the set session step in server connect and store it in the defined session ... the rest is what i explained in my previous post.
Replied 22 Jan 2018 19:41:18
22 Jan 2018 19:41:18 Dan Everton replied:
should i add this in $_SESSION as a var, array or object

also can i add a function as part of the login which sets the session on click? or other?

thanks for your help
Replied 23 Jan 2018 08:19:24
23 Jan 2018 08:19:24 Teodor Kuduschiev replied:
Well, for ID you need a session var.
Yes, this should be a part of the login action - not on click. Just open your login server action, after the login step add a SET VARIABLE step and use the login Id as its value.
With server connect it is really easy to build anything, as all you need is to follow the logic and add the required step wherever it is needed.
In your case the logic is already described in your question, so login, then set session value - really really easy.
Replied 25 Jan 2018 17:34:32
25 Jan 2018 17:34:32 Dan Everton replied:
Hi Teodor,

Try as i might this still does not work.

Are you able to help please as i have spent so long on this.

You can try www.redhousebarn.co.uk/secure/

user: alison-mike-2018-09-22
pass: test

Images which may help: www.redhousebarn.co.uk/dmxHELP/Capture.JPG

www.redhousebarn.co.uk/dmxHELP/Capture1.JPG

www.redhousebarn.co.uk/dmxHELP/Capture2.JPG

Please please help.

Dan
Replied 25 Jan 2018 18:11:25
25 Jan 2018 18:11:25 Teodor Kuduschiev replied:
I see errors the way you set this up...
Set session step name must be the name of the session you want to set value to - the same you defined under globals> session .... it's value must be the identity returned by the logged user.

Currently your set session step makes no sense.
Replied 25 Jan 2018 18:56:24
25 Jan 2018 18:56:24 Dan Everton replied:
ok - so my question is - does it have to be primary key?

As in ID?

ID is not present in login form so how to set.

Could you give me a steer on what each value should be

Once i have achieved it once i'm certain it will be fine but i am struggling to correlate the two.

Thanks
Dan
Replied 25 Jan 2018 19:33:01
25 Jan 2018 19:33:01 Teodor Kuduschiev replied:
In set session step, for value select the identity returned by the login step. It is not supposed to be in the form.
Replied 26 Jan 2018 11:27:03
26 Jan 2018 11:27:03 Dan Everton replied:
Hi Teodor

Is there any chance you could hop onto live chat so I can get this last bit resolved and discuss- it should only take 5 mins and would be very much appreciated

Dan
This reply was removed on 1/26/2018 11:50:19 AM.
See the changelog
Replied 26 Jan 2018 12:19:21
26 Jan 2018 12:19:21 Dan Everton replied:
Hi Teodor - could you spare me 5 mins please?
Replied 26 Jan 2018 12:36:40
26 Jan 2018 12:36:40 Teodor Kuduschiev replied:
Our live support is not available today. Use or support forums
Replied 26 Jan 2018 12:46:35
26 Jan 2018 12:46:35 Dan Everton replied:
ok - can we discuss via this forum?
Replied 26 Jan 2018 12:55:37
26 Jan 2018 12:55:37 Dan Everton replied:
ok - i'll start the ball rolling then.

At what exact point in the workflow am i setting session to primary ID?

thanks
Dan
Replied 26 Jan 2018 13:08:21
26 Jan 2018 13:08:21 Teodor Kuduschiev replied:
Dan, i have already explained you this in the last few posts.
Just read my posts:


QuoteWell, for ID you need a session var.
Yes, this should be a part of the login action - not on click. Just open your login server action, after the login step add a SET VARIABLE step and use the login Id as its value.
With server connect it is really easy to build anything, as all you need is to follow the logic and add the required step wherever it is needed.

Replied 26 Jan 2018 13:30:28
26 Jan 2018 13:30:28 Dan Everton replied:
yes i see that thanks but the thing i can't wrap my head around is how to set a var if it does not exist in the form.

i'm sure my scenario is not uncommon.

If i screen grab my steps can you annotate and reply so it is clear please?

Thanks
Dan
Replied 26 Jan 2018 13:32:49
26 Jan 2018 13:32:49 Dan Everton replied:
could you perhaps explain clearly in steps?

1)

2)

3)

4) etc please
Replied 26 Jan 2018 13:40:50
26 Jan 2018 13:40:50 Teodor Kuduschiev replied:
Dan, your scenario is very common. Is till don't understand why do you think some ID must be in the form ... the ID is returned by the LOGIN STEP.
Just put a set session step after the login step and use the login step identity as its value.
Replied 26 Jan 2018 14:00:33
26 Jan 2018 14:00:33 Dan Everton replied:
ok - can you clarify please - on the actual login page (www.redhousebarn.co.uk/secure/)

Do i need to assign anything to the actual form or is it all handled via a server behavior?

Thanks for your patience

Dan
Replied 26 Jan 2018 14:10:07
26 Jan 2018 14:10:07 Teodor Kuduschiev replied:
you do not have to assign anything on the form. Everything is being handled in the server action the way i explained and re-explained in my previous posts in this topic.
Replied 26 Jan 2018 14:10:36
26 Jan 2018 14:10:36 Dan Everton replied:
ok i will try again and let you know
Replied 26 Jan 2018 14:23:32
26 Jan 2018 14:23:32 Dan Everton replied:
so this is correct?

www.screencast.com/t/XF0o4DcxR
Replied 26 Jan 2018 14:33:49
26 Jan 2018 14:33:49 Teodor Kuduschiev replied:
No Dan, it is not correct.
Why are you setting the value of the Session called ID to itself? What is the logic behind this???

I explained this to you like 10 times, here in the forum and in the chats - Use the identity returned by the login step as value for your session ... really i don't know how else to explain such a basic step, used by thousands of users...
Replied 26 Jan 2018 14:34:58
26 Jan 2018 14:34:58 Teodor Kuduschiev replied:
Just follow the logic of what you need to achieve -> user logs in, then the logged in user id goes to the session value.

Reply to this topic