Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have a some forms that stores data in my page.
I want to find a way to temporarily save the data entered by the user in navigating and keep until the order is confirmed.
Can anyone help me?
This is exactly what sessions are for
While I was working on e-commerce sites we used to keep all the order data
in sessions until user confirms order by going to payment gateway.
You can use PHP Session as arrays and store your data temporary and then destroy the session.
$_SESSION['cart'][] = //you data here
Sessions and cookies are used for this purpose but sessions are more secure and reliable.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Is it possible for someone (hacker), to somehow get a hold of the value of a session variable that is active.
In the normal course of events, the only information about a session available to the client is the session ID.
For data stored on the server (even if it connected to the session ID) to be visible to the client then you need either:
To expose it explicitly
To have a security vulnerability
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I was wondering if it was a good practice to store the infos we retrieved from a DB (more specificaly the user infos) inside a session, useful for the login for example :
e.g :
$sql="SELECT * FROM USER";
$result=$myConnexion->query($sql);
$line=$result->fetch_assoc();
$_SESSION['login']=$line['login'];
$_SESSION['name']=$line['name'];
...
It then would be easier to display infos, welcome messages and so on.
What do you think ?
Thank you for your time
It's perfectly fine. Make sure you only store Public info you might need later on, meaning don't store the password or the user's ID in the db.
Yes, it's fine, as long as you don't store sensitive data, like the password, or the user name. You can check this for more
Using PHP SESSION Variables to store MySQL query results
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have a some forms that stores data in my page.
I want to find a way to temporarily save the data entered by the user in navigating and keep until the order is confirmed.
Can anyone help me?
This is exactly what sessions are for
While I was working on e-commerce sites we used to keep all the order data
in sessions until user confirms order by going to payment gateway.
You can use PHP Session as arrays and store your data temporary and then destroy the session.
$_SESSION['cart'][] = //you data here
Sessions and cookies are used for this purpose but sessions are more secure and reliable.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Is it frowned upon/ a bad idea to store information temporarily in a session variable to give access to that information globally?
I have a file upload parser script that is called by ajax on submit of a form and I need to send back data at different parts of the script. I figured saving the information I need in different session variables might be a good idea.
In your case you can store temporary data ( not critical data which compromises with the security ) as a session cookie in the clients' browser.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have a some forms that stores data in my page.
I want to find a way to temporarily save the data entered by the user in navigating and keep until the order is confirmed.
Can anyone help me?
This is exactly what sessions are for
While I was working on e-commerce sites we used to keep all the order data
in sessions until user confirms order by going to payment gateway.
You can use PHP Session as arrays and store your data temporary and then destroy the session.
$_SESSION['cart'][] = //you data here
Sessions and cookies are used for this purpose but sessions are more secure and reliable.