How to Authenticate Users: JWT vs. Session

How to Authenticate Users: JWT vs. Session

Blog
In web applications, you try to decide when to use either JSON Web Tokens (JWTs) or sessions (cookies) for authentication. When you browse the web you use HTTP, which is a stateless protocol. So, the only way to remember the states of your application is using either sessions or tokens. Goals This article deep dives into: Differences in using sessions and JSON Web Tokens for authentication How server-side session store works Advantages of sessions over JWT Advantages of using JWT and other things concerning the structure of JWT. JWT vs. Session: What to Use? Deciding to choose between JWT or session is not just choosing one over the other. You need to look at some factors to determine which one to use in an application. In order to figure this…
Read More
Efficiently delete a million files on Linux servers

Efficiently delete a million files on Linux servers

Blog
It happens to the best: some script rockets to the skyline resulting in an instand system administrator headache because some folder - typically, sessions - was stuffed with millions of files. Linux is not quite happy with that, deleting the folder is not an option and the loyal "rm -rf" command decides to call it a day. To make things even worse: you want to remove only files of some days ago... what are the options? Find is you friend The Linux "find" command is a possible solution, many will go for: find /yourmagicmap/* -type f -mtime +3 -exec rm -f {} \; The command above will give a list of files older than 3 days and will pass each found file to the rm command. The rule above has…
Read More