Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Auth (Session) example

Simple authentication example with a session cookie using next-session

Setup

tinyhttp new session

Run

node index.js

And in another terminal:

  1. To login
curl -d "user=admin&pwd=admin" -v http://localhost:3000/login

From the response of the above command, note the value of the sid cookie value

  1. To verify session (replace the cookie value obtained from the above output)
curl -H 'Cookie: micro.sid=COOKIE_VALUE_HERE' http://localhost:3000/admin