Ionic Login Session

Ionic Login Session

Ionic Login Session - Create users, login, logout, save sessions, reset password




Member since 2015


iOS, Android  
5 years ago
1 year ago

Ionic Session Login - A barebone full stack application that takes the pain away from creating user accounts, login, logout and session saving. It uses Node, Express, MySQL, Sequelize on the backend and Ionic on the Frontend. Save time and quickstart your app development with this awesome starter kit!

It can easily be modified to use MongoDB or some other DB system. This application creates user accounts from emails and passwords. Passwords are encoded with crypto.

This application does not send or verify emails. It simply creates the accounts. It uses emails as usernames to verify they are unique. This can be easily changed to allow both email and username login.

If you need social oauth login as well then check out my other starter Ionic Social Login Oauth

Check out my other useful starters are here: Great Ionic Starters.


  • Create Users
  • Login
  • Logout
  • Prevent duplicate accounts
  • Encrypt Passwords
  • Save Login Session
  • Password Reset (New)

The server dependencies:

  • "body-parser": "~1.12.4",
    • "connect": "^3.4.0",
    • "cookie-parser": "~1.3.5",
    • "debug": "~2.2.0",
    • "express": "~4.12.4",
    • "express-session": "^1.12.1",
    • "morgan": "~1.5.3",
    • "mysql": "^2.9.0",
    • "node-gyp": "^3.2.1",
    • "q": "^1.4.1",
    • "sequelize": "^3.14.1",
    • "serve-favicon": "~2.2.1",
    • "jade": "~1.9.2"

Server Instructions

  • Go to the Server folder
  • Install node.js Node.js Installation
  • In the folder run npm install
  • Install Express Server npm install express --save
  • Install Express Session npm install express-session
  • Install Connect npm install connect
  • Download & Install MySQL
  • Create a db: 'mydbname' (you can change this).
  • To create the db you can run mysql -u root -e "create database mydbname";
  • In Server app.js you have to update your own mysql parameters: dbname , user, password, url and port.
  • npm install mysql
  • Install Sequelize npm install sequelize
  • Install mysql option npm install --save mysql
  • Install nodemailer npm install nodemailer
  • Start server with npm start

Usage via http post

FrontEnd Instructions

  • Install Ionic
  • Download Genymotion if you plan to emulate on android
  • open Frontend folder in terminal
  • Install Ionic sudo npm install -g ionic
  • add platforms ionic platform add ios
  • add platforms ionic platform add android
  • ionic emulate ios (do not run with livereload)
  • ionic run android (after you start genymotion emulator instance)

Running as a website

  • [Enable CORS requests](http:

Password Reset Setup

Node.js App Deployment Tutorial

  • It is highly recommended you use as your app hosting service
  • Read my tutorial on [How to Deploy Node.js app to Heroku](http:

Common Issues

  • If you're using Android Emulator or testing on a Smartphone, you cannot access your computer's localhost. In the Frontend/www/js/services.js you have to replace all the localhost references with your computer external ip such as 192.x.x.x. Find out what your computer's IP is and put it instead of localhost. Make sure the smartphone and your computer are on the same wifi network or your server is accessible globally.
  • If you try to run with ionic server or ionic run -l you will encounter Cross Origin Issues (CORS). You can read about it here.

Payment Information

  • The payment on this site is processed by and sometimes your bank will decline the charges if they don't recognize it. You can contact your bank or try a different card.


  • Leave a comment if you get stuck on anything
  • If you email me directly it might get caught in the spam filter
  • And Kudos if you leave a Rating! =)

Stay in Touch

Icon made by [Freepik]( "Freepik") from []( "Flaticon") is licensed under [CC BY 3.0]( "Creative Commons BY 3.0")