Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6340371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:49:21+00:00 2026-05-24T19:49:21+00:00

Scenario No 1 On page1.php I use php with MySQL to get a product’s

  • 0

Scenario No 1

On page1.php I use php with MySQL to get a product’s data to the page. When a user wants to proceed to page, 2 he clicks on a button.

On page2.php there is also some info about the product, mainly for checkout purposes. For this data to be displayed I make use of the ID of the product so page2.php is actually page2.php?id=123. Therefore, using again PHP and MySQL I get the data I need.

Scenario No 2

On page1.php I use php with MySQL to get a product’s data to the page. The needed values for page2.php are stored in sessions. When a user wants to proceed to page 2, he clicks on a button.

On page2.php now, the information about the product is shown using sessions. This time page2.php is actually page2.php that it is shown on the address bar.

I prefer doing this with scenario 1. The user will be able to copy/paste or send through a button the page to a friend for direct access. I don’t think that one more hit to the db is a problem.

What is your opinion ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:49:22+00:00Added an answer on May 24, 2026 at 7:49 pm

    I would agree that scenario 1 is better. You should use a session for its intended purpose, carrying state of a particular user, not misuse it as some form of caching mechanims in my opinion.

    That’s why you use the database in the first place – to have efficient access to your data. Why try to build a cache around the thing that should actually improve the efficiency if used?

    If access ever becomes a bottleneck and you really need to look into caching, then there are still better mechanisms than to use your session for this purpose.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following scenario. I have a index.php page with the following JQuery
Scenario: I have a login page which uses ajax to validate a user and
Here is my scenario. User fills out this large page which is dynamically created
Scenario: I have a php page in which I call a python script. Python
The scenario (all happening within the administration area/backend): From the listing page, the user
Consider the following scenario: Page written in classic ASP or PHP, which is rendering
We have a scenario where on the product page we have a few text
Scenario: A website I use to research stock data has a link on the
Here is the scenario, User Logs In User gets up, goes to get some
Scenario: Every page on the website will have a menu bar at the top

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.