Hi I am trying to pass a session variable between two pages but unable to.
User Log In dmx-on:success="carnival_local.set('user',email.value,{});browser1.alert(carnival_local.data.user);browser1.goto('index.php')">
On success a session variable is set using a form field value. I can confirm this by having an alert display the new session value.
However when I move to another page and try to display the same session value in another alert. It is empty
I never saw an answer and I am having the same issue for hours now.
The login page has a value called “username” – which is purely a number such as ‘8998680’ (example)
I have followed the tutorial closely to use the State management component here and then to pick it up on another page by accessing the same State management component.
No matter how I apply it as a dynamic value for an form input or binding it to a text title … it is not on the page.
Inspector doesn’t show me any errors.
So I am thinking that my Security action used to validate the login username and password against a table before allowing the user to continue is Blocking
setting the same Username value as a session usable later.
Here’s the login page that sets the session for value “sessionusername”
You could add a database query using the security provider ID to filter the user after your security login step. Then create a repeat step after your login action. Select the query used to filter the user as the expression, then pick the fields you wish to repeat from the expression. Then in steps select core action / set session. Pick the field you wish to use for the session value and name it sessionusername. Now when you login successfully it will select the matching users record and set the necessary session to the value you selected. You can then use this session for other filtering uses within your application.
Basically you’re saying I have to go 7 extra miles for a procedure that should only take a walk down the block.
I set up a query that asked for the values I wanted from another table on the next page after successful login.
The query said to match up the unique record whose Username field matched the Session value of Username established at Login.
But it was the complete failure trying different methods to make the Username – either retrieving the POST value just submitted or getting it as a SESSION value under another name – that has me ground to a standstill.
I am sorry but again I don’t understand what are you referring to and what are you trying to do.
Your explanations seem really chaotic and not logical to me - I just can’t get your idea and logic.
It’s explained in the docs how to pass values between the pages using the state management. Check it please:
I went through these steps setting up a browser session utilizing the Submit button.
I tried it several times & didn’t get the value passed through.
So I tried the other instructions that intimated that the Session State management component was quite capable of doing this – just as normal php pages do — set Session go & retrieve it.
I had hopes that after the browser method didn’t work that this spiffy Session State management component was quite capable of doing the deed by being because it was Managing a simple Session value — and holding on to a Session value long enough to get to the next page intact.
Probably if you explain what do you actually need to achieve instead of what you have tried to do (which may be wrong in your specific case) would be more helpful.
Your screenshots show nothing related to an event which sets a value to the session! So I don't see how do you set a value to this session to be able to answer what you did wrong.
That makes no sense to me and is quite disrespectful. Wappler is saving you hours, if not weeks, writing and debugging complex code. I've outlined what you need to do above. Rather than get annoyed at those offering support why not take five minutes to relax and then follow the instructions...
On the contrary, for me, Wappler has added days and days of work and troubleshooting.
If you tell developers that passing a session value from the login page to another page must be done in such a excruciatingly complex fashion BECAUSE of WAPPLER
it would not translate as “saving hours, if not weeks”.
DISRESPECT is from people who say “why not take five minutes to relax and follow the instructions”
I’ve become an expert on so many programs by spending hours and hours of intensive study and trial & error where instructions are missing.
I could recite and handwrite out what the Documentation says in so many places.
Anyway, I am closing up Wappler.
The main problem is javascript ---- tons and tons of it – more than is needed to load a page to do simple, basically Bootstrap pages.
There is no query in your action to select the user. You need to use the security provider ID to filter your user via a simple query as outlined by Teodor. Then you can use the filtered user to set all the sessions you could ever need… There are probably several ways of doing this but this is the method we have used repeatedly with success and no issues.