verdeandrea Posted August 2, 2016 Share Posted August 2, 2016 Hi guys, here is my scenario. In my page everyone can submit a simple form with just a input text. User (guest user, no registration needed) writes something in this field and the submits it (the form is submitted via ajax so i don't refresh the page). Every text submitted is saved as a new page. After this step i ask to the user if he/she wants to register his email in order to be updated with infos about his submission. Now, if the user decide to leave his email i need to relate this email with the previously submitted text. What's the best way to do that? Working with some session variable? Putting the new page id in an hidden field? Cookies? Something else? Thanks! Link to comment Share on other sites More sharing options...
LostKobrakai Posted August 2, 2016 Share Posted August 2, 2016 I'd return a hashed id – two way hashing, just to to disguise the real id – with the ajax call and put that one in a hidden field. 1 Link to comment Share on other sites More sharing options...
verdeandrea Posted August 2, 2016 Author Share Posted August 2, 2016 Thanks @LostKobrakai! Why do you think that is better than a session variable? (I'm asking just to understand better) Link to comment Share on other sites More sharing options...
LostKobrakai Posted August 2, 2016 Share Posted August 2, 2016 I'm not really a friend of the session variable, so mostly personal preference. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now