Any idea why i can't set sessions?

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

I meant the Variables… they have a Global Name which i never understood

Honest answer, no idea, always used sessions under those circumstances. Why not give it a try?

EDIT
On thinking about it, i doubt it, I believe a variable set as global means global scope within that action as opposed to local scope within a specific section such as a repeat

It appears I answered that quesion in August last year (then forgot) - :rofl:

1 Like

WOW! great answer! thanks! it was bugging me :slight_smile:

Ok sessions are working finally, in the test u suggested i Bound the var to the wrong thing.

and u are right they don’t output so that was confusing.

thanks for the help.

1 Like

Just an extra comment to add to what’s already been mentioned:

I think the sessions variables would have been set correctly from the beginning - ie as in your first screenshot. If you have access to the session files created on the server (eg if you’re using a local server), you can open the session files and see the data has been created - whether from static values or dynamic values retrieved from a database.

The trick is getting access to them in Wappler (which @Hyperbytes has explained).