Skip to main content

Posts

Showing posts with the label Angular 5 and 4 Token Based Authentication

Advantages of Token-Based Authentication - Angular 5 and 6

How to set in Angular cookies, type number values? Why is Token Based Authentication more preferable Then Cookie based? The cookie-based authentication has been the default and the cookie-based authentication is stateful. What is Stateful? Keep and track the previously stored information which is used for a current transaction. A stateful service based on HTTP cookies uses the HTTP transport protocol and its ability to convey cookies, used as session context. What are the Cookies Limitations? We can only store around 20 cookies per web server and not more than 4KB of information in each cookie and they can last indefinitely should you choose to specify the max-age attribute. Token Based Authentication - The Token-based authentication has received expansion over last few years due to RESTful Web APIs, SPA and so on. The Token based authentication is stateless. What is Stateless? Every transaction is performed as if it was being done for the very fir...

Angular Cookies QAs

What is a Cookie? A cookie is a small piece of data sent from a website and stored on the user's machine by the user's web browsers while the user is browsing.                                                                                  OR Cookies are small packages of information that are typically stored in your browsers and websites tend to use cookies for multiple things. Cookies persist across multiple requests and browser sessions should you set them to and they can be a great method for authentication in some web apps. How to install a cookie in Angular? Install cookie - npm install ngx - cookie - service – save If you do not want to install this via NPM, you can run npm run compile and use the *.d.ts and *.js files in the dist-lib folder After ...