PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, September 4, 2022

[FIXED] How to prevent back button going to secured page when already logout in node JS

 September 04, 2022     authentication, express, node.js, session     No comments   

Issue

I am creating a authentication using node JS and express ,when user logout i destroyed the session ,but the problem is while pressing browser back button it goes to the secured page,how to prevent it .When visiting the secured page directly through the URL, its fine, it redirect to login page if not login


Solution

This is probably your browser caching data. You should set your server to respond with the header Cache-Control: no-store, no-cache If you want to go a step further you can use the nocache middleware created by the same team that has created helmet



Answered By - konkas
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing