node.js - Best practice for displaying user info on home page with GET request -


my node.js (express) server keeps track of whether or not user logged in.

if user logged in , homepage requested, serves homepage user's name in top hand corner. otherwise, serves normal homepage. done handlebars.js.

i read requests supposed idempotent. i'm not sure if doing violates rule. www.google.com, example, loads icon , email in top right corner. i'm doing okay? if not, best practice?

i think fine , considered 'normal' behaviour. i'd argue making page idempotent vary hard task on 'dynamic' website although might vary site-site though.

with bit of re-engineering might possible, example let's have application requires authentication, instead of sending user homepage renders user's dashboard, instead route '/dashboard would, part, classed idempotent ('/dashboard' show dashboard).


Comments