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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:35:24+00:00 2026-06-18T06:35:24+00:00

I am currently working on a website built with Backbone.js. The site has a

  • 0

I am currently working on a website built with Backbone.js. The site has a RESTful API built in Symfony with FOSRestBundle. Developing was going fine, until I stumbled in to some user-related tickets.

From what I understand, the best way to handle this type of problem is with a token based system, where the user gets an access token after an approved login. I will describe my current perception of the workflow, and ask questions along the way. More importantly, please correct me if I have misunderstood.

First, the user the accesses the login form, then the user types in credentials, and an AJAX request is send to the server. From what I understand this should all be handled with SSL, but with Backbonejs, you can’t simply say that the login page should be accessed with HTTPS, as Backbone is a one-page framework. So will this force me to use HTTPS through out the application?

In the next step, the REST server validates the credentials, and they are approved, then the REST server sends an access token to the client. Is this token saved (on the client-side) in local storage or a cookie?

Also is the login stored at the server, so that the REST server can log the user out after a certain amount of time?

Now, the client sends this access token along with other request, so that the server can identify the client, and approve the request or not. So the access token is also stored on the REST server?

Lastly is this what the smart people call “oauth”, or does it relate to it?

Thank you.

  • 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-06-18T06:35:26+00:00Added an answer on June 18, 2026 at 6:35 am

    Let’s take your questions one at a time.

    From what I understand this should all be handled with SSL, but with Backbonejs, you can’t
    simply say that the login page should be accessed with HTTPS, as Backbone is a one-page
    framework. So will this force me to use HTTPS through out the application?

    Ok, there’s a lot to unpack there. Let’s start with SSL/HTTPS. HTTPS is a protocol; in other words it defines how you send packets to/from the server. It has nothing whatsoever to do with whether your application is single or multi-page; either type of site can use either HTTP or HTTPS.

    Now, that being said, sending login info (or anything else containing passwords) over HTTP is a very bad idea, because it makes it very easy for “bad people” to steal your users’ passwords. Thus, whether you’re doing a single-page or a multi-page app, you should always use HTTPS when you are sending login info. Since it’s a pain to have to support both HTTP and HTTPS, and since other, non-login data can be sensitive too, many people choose to just do all of their requests through HTTPS (but you don’t have to).

    So, to answer your actual question, Backbone isn’t forcing you to use HTTPS for your login at all; protecting your users’ passwords is forcing you.

    In the next step, the REST server validates the credentials, and they are approved, then
    the REST server sends an access token to the client. Is this token saved (on the
    client-side) in local storage or a cookie?

    While any given framework might do it differently, the vast majority use cookies to save the token locally. For a variety of reasons, they’re the best tool for that sort of thing.

    Also is the login stored at the server, so that the REST server can log the user out
    after a certain amount of time?

    You’ve got the basic right idea, but the server doesn’t exactly store the login … it’s more like the server logs the user in and creates a “session”. It gives that session an ID, and then whenever the user makes a new request that session ID comes with the request (because that’s how cookies work). The server is then able to say “oh this is Bob’s session” and serve the appropriate content for Bob.

    Now, the client sends this access token along with other request, so that the server can
    identify the client, and approve the request or not. So the access token is also stored
    on the REST server?

    If you’re running two separate servers they’re not going to magically communicate; you have to make them talk to each other. For this reason your life will be easier if you can just have one (probably REST-ful) server for your whole app. If you can’t, then your REST server is going to have to ask your other server “hey tell me about session SESSION ID” every time it gets a request.

    Lastly is this what the smart people call “oauth”, or does it relate to it?

    Kind of, sort of, not really. OAuth is an authorization standard, so it’s sort of tangentially related, but unless your login system involves a whole separate server you have no reason to use it. You could use OAuth to solve your “two servers, one REST-ful one not” problem, but that would probably be overkill (and regardless it’s outside the scope of what I can explain in this one Stack Overflow post).

    Hope that helps.

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

Sidebar

Related Questions

I'm currently working on a website built with symfony 1.4 and I need to
I'm using Meioupload on a website built with CakePHP, and it is working fine
I'm currently working on a website for a photographer, every photo is tagged with
I'm currently working on a website which is displaying users tweets from the twitter
I am currently working on a website that will have a high volume of
I am currently working on a website which lists the businesses as per either
I'm currently working on a website for my church's college group, and am started
I'm currently working on a website for a client and I'm getting a strange
I'm currently working on a website in PHP, and I'm wondering what the best
I am currently working on a website that requires the ability to overwrite the

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.