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

  • Home
  • SEARCH
  • 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 7435067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:59:55+00:00 2026-05-29T09:59:55+00:00

I’m building a mobile interface with JQuery Mobile for an already existing web app

  • 0

I’m building a mobile interface with JQuery Mobile for an already existing web app which requires user authentication, and I cannot settle on the best approach for implementing a login process.

I’m not so concerned about the server side authentication, but rather how to implement it on the user side.

After some experimenting, it seems that the options are:

  1. Standard form submit with POST\redirect:
    -Disable automatic ajax with data-ajax="false"
    -User submits, check credentials at server, then send redirect to app on success or back to login page on failure.

  2. Ajax method with $.mobile.changePage
    -Send username/passwd via Ajax
    -Based on response, either add front page of app with $.mobile.changePage or display error message

  3. Ajax method with window.location.replace
    -Similar to option 2, except use window.location.replace to add front page of app

  4. Ajax method with POST; redirect only on failed login
    -Keep ajax enabled for form submissions.
    -On the server side, combine your user authentication function with the entry page of your app in such a way that it only executes if the form fields are set.
    -On successful login, return front page of the app.
    -On failed login, redirect back to the login page.
    -If the form values are not set, check if the user is properly logged in and then return the standard output page. If not logged in, redirect back to login.

Some considerations:
-It must use POST to avoid attaching login data to URL
-Maintaining correct back button functionality so that navigation is user friendly appears to be kind of tricky.
-I’d like to make the process flow as easily as possible with as few page reloads as possible

Any ideas?

EDIT:
I found a 4th method, which may be the best approach. It avoids the back button functionality issues resulting from the POST/redirect method. If the user authenticates on the first attempt, the smooth page transition is maintained the entire time. If not, the page transition flow will be continuously maintained after successful a login. Furthermore, all of JQM’s built in error handling features remain available.

  • 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-29T09:59:55+00:00Added an answer on May 29, 2026 at 9:59 am

    Basically that’s according to the need.

    Standard form submit( Point 1) is a very clear cut way, but if login is failed, need to reload the page so, multiple requests( one for login-check, another for page-load) are made & also, need to populate back input data.

    Some advantages for AJAX r-

    • If connection is closed or network failure, we can show proper error- keeping the page design intact. In case of standard submit- it will show connection error- in which point user may need to restart the mobile-app.

    • In future use, if we force user to login to view content of a page, AJAX can simply do that trick, quickly. So we can put that login-box every-where & log in user without interrupting current state.

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

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
We're building an app, our first using Rails 3, and we're having to build
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from

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.