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 6560725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:29:53+00:00 2026-05-25T13:29:53+00:00

Right, im building an order form for a site that doesn’t require any kind

  • 0

Right, im building an order form for a site that doesn’t require any kind of user signup or authentication. The form has three models: Order, OrderImage, Print. An order form has many OrderImage’s and an OrderImage has many Prints.

A user requires the ability to Upload images (OrderImage’s) with their order and also the ability to go back and edit each OrderImage before the Order is confirmed and submitted.

The form is multistep and made up of four stage:

  1. Upload Images
  2. Review Uploads
  3. Your Details
  4. Confirm Uploads

This is fine and everything is working as planned and data is stored to the database throughout the Order process as the user enters more details or uploads more images.

However, this means URL’s such as “/upload?order=5” exist which isn’t good. Because there is no authentication this means anyone could potentially guess the URL of an Order and change it.

So i’m just wondering what the best way of managing this process is? I’ve got a couple of ideas in mind, but not sure if any of them are the best solution for the problem:

  1. Generate a random order number within 6 digits for example so the url would be more like: “/upload?order=645029”. This would result in there being less chance of someone guessing an order number, but really not very secure still.

  2. Combining the above idea with a status on the order, such as “Complete”. So when an Order is finally submitted, it is marked as complete. I could then prevent any “Complete” orders from being accessed again. However, during the Order process, the order number could still be guessed and tampered with.

  3. Making use of the session and storing the order number here instead of in the URL, or as a hidden value in the form.

I have watched Ryan Bates’ Railscast on Multistep forms in which he stores data in the session. However, Ryan himself concedes that storing complex Models and objects this way isn’t practical.

So any suggestions on the best way for handling a non-authenticated order form would be much appreciated, thanks.

  • 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-25T13:29:53+00:00Added an answer on May 25, 2026 at 1:29 pm

    I would go with option #3. You’re right that it’s not good to store complex objects in the session, but all you need to store is the ID number of the order, then you can look it up in the database. You can use a before_filter to ensure that the requested order belongs to the current user:

    class OrdersController < ApplicationController
      before_filter :check_ownership, :except => [:new, :create]
    
      private
    
      def check_ownership
        redirect_to '/' unless params[:id] == session[:current_order_id]
      end
    end
    

    This example could easily be extended later to allow users with accounts to view their order history (rather than just the current order). Options #1 and #2 are only masking the problem, and would probably be more difficult to extend later.

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

Sidebar

Related Questions

I'm currently building an order form but it seems that the method I am
I'm building a site right now, so far I've painfully forced everything to be
I'm building a game in as3 that has balls moving and bouncing off the
I'm building an extension to add a specific block right before the 'Place Order'
We are building a web based solution right now and it is almost ready
Hoping someone can point me in the right direction. I'm building a online shop
We primarily use an ASP.NET environment at work. Right now I'm building an application
Right now, I keep all of my projects on my laptop. I'm thinking that
Right now I'm building a project management app in rails, here is some background
Right now I'm building a project management app in rails, here is some background

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.