Take the 2-minute tour ×
User Experience Stack Exchange is a question and answer site for user experience researchers and experts. It's 100% free, no registration required.

I am building an application and I'm very much using the SPA (Single Page Application) approach. This means my page never reloads and everything is done through AJAX or sockets. However, I do have one exception: The login/logout is done in the traditional way. So, my application is essentially two SPA's one "public" (if you're not logged in) and a "private" (for logged in users).

I was wondering if other people have adopted my approach or if I should instead try to make a single SPA. Here are few advantages/disadvantages I can think of.

Advantages (of having two SPA's)

  • When the user opens the public app, he doesn't have to load all of the "private" assets which can be quite substantial. This makes the initial page load faster.
  • The page load makes the user feel something has happened. This is hard to explain but, it's kinda like that feeling when you see the gmail loader fill up and your app appear.

Disadvantages

  • I think the process of login/logout is slower because each time you have to reload the assets.
  • We're breaking away from the SPA approach.
  • More server requests which can potentially slow down the server.

So yea I'm just curious if people have you used my approach before or if the have other pros/cons to add.

share|improve this question
1  
The point of logging out is to get rid of the data on screen, so I think most people would want the page to refresh...possibly to a mostly blank 'you have successfully logged out' type of message. –  DA01 Mar 21 at 20:55
    
I have a similar app and I have a separate login page precisely for the advantages you list above. Plus I think it is safer. –  pathfinder Mar 22 at 2:29

2 Answers 2

up vote 3 down vote accepted

I faced that scenario and i find out that having an AJAX login is more complex than a refres login.

A AJAX login requires 2 things:

  1. dont allow access to the user to related app. You can do this by placing a div in from but can be remove it by opening the console and delete that login. Which in some way you have to strictly block access if the user is not log in.
  2. Once the user log in successfully. You have to load the whole app by AJAX that may produce some issues if your target browsers include ie8-9.

And a bonus:

  1. The response, if the application is kind of heavy, can be much lower than actually load the app directly which will affect the user experience.

  2. I've Never seen an AJAX login

share|improve this answer

I was dealing with this a couple of years back - was working on a system that had an Ajax login/logout (using ExtJS) and one that did it with a separate login page.

I can hardly remember any of the reasons, but do remember we had a multitude of issues with the ajax login.

The one I remember the most was security - the submit as done via traditional page refresh is more secure than sending passwords over ajax (effectively making the script aware of the password and letting anyone with access to the computer to see the password in FireBug or Chrome developer tools). There a bit of debate about this on StackOverflow, so would look in there.

I also vaguely recall problems with session timeouts.

I'm sorry that this isn't the most detailed answer, but do make sure that if you do the Ajax login, you are aware of all the complexities.

share|improve this answer
    
+1 "the submit as done via traditional page refresh is more secure than sending passwords over ajax" –  Misters Jun 5 at 12:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.