Any idea why i can't set sessions?

I’m trying to set server sessions but they keep showing null. any ideas?

1

You need to add a Repeat. Core Actions - Repeat. Then select your Expression getgroupid? Select the columns you want to output. Then Core Actions - Set Sessions, and select the variables you repeated in the output, give them a name and tick Output and save your Action.

2019-11-23_12-33-44

Have you also defined the session variables in Globals? This is needed to actually create the session variable before assigning a value with set session.

I only ever user Globals/Session in a query with a session that has already been created. Have never used this to set a session..?

Ah that’s probably it! It’s only one record anyway.

But i also set a static test session and that came out null too. (yes i added under globals)

i’ll keep trying.

that’s my next question. Do i need to create global sessions before setting a session?

Yes, that is what I meant. If the session is not defined in goibals it won’t set

As I mentioned I only use the Globals area for filtering using sessions that already exist. Interested in how @Hyperbytes creates a session in this way?

Disregard my above question :slight_smile:

tried again… no luck
maybe issue with server?


Use a Repeat as outlined above.

But i’m not using any db value
its a static test value.

Yes, you are correct Kattouf, no need for repeat in that last one. Everything seems correct, I suspect there is a server issue

EDIT * although I see the session is set a number and you are assigning a string *

i suspect that too. i will investigate. thanks

Am sure we set some static values using a Repeat but can't find the example... Please still try by setting a Repeat and setting your static value, maybe it will work?

Dave, i do what he has done all the time with no problems

Guys,
No repeat is needed when you set a static value in a session :slight_smile:

1 Like

I've not done this (in this way) so will leave the support in your capable hands sir.

Sorry, just remembered.

Output on a session value does not work, it never has

try assigning the the session to a variable then outputting the variable (yes, it is a hack but it works) like this

image

You will see the output of that is:

image

The session outputs null but the variable with its value assigned returns the real value

The session is being set, it just isn’t reported correctly

1 Like

Makes sense,

But i had earlier did a conditional where i compared sessions to a parameter and that kept failing because session was null.

anyway it’s clearly my server …

Regarding Variables, Does global mean i can use them in other actions? Do they go under $_server like we do for $_session?

yes, If you define a session under Globals, say $_SESSION.myvar in a server action then adding that same session name to another server action will make the value of that session available in that Server Action