PHP Code to Node.js Code Conversion

General Discussion
  • Banned
    #1

    I have the following piece of code:

    session_set_cookie_params(0, '/', '.site.net');
    session_start();
    if(!isset($_SESSION["auth"])) {
      $_SESSION["auth"] = true;
      header("Location: https://secure.site.net/auth?return_url=https://forums.site.net$_SERVER[REQUEST_URI]");
    }
    

    How can I convert this to Node.js and where should I place it so that all requests to my NodeBB forum pass through this? I can't figure out how to do this.

  • #2

    Assuming that you use it as a reverse proxy, I think you can do something similar with NGINX by mixing these guides:


Suggested Topics


  • Node JS NewBie

    General Discussion
    1 Votes
    2 Posts
    146 Views

  • 0 Votes
    8 Posts
    1444 Views

  • 0 Votes
    2 Posts
    573 Views

  • 1 Votes
    3 Posts
    1073 Views

  • PHP doesnt work

    General Discussion
    -2 Votes
    9 Posts
    2340 Views

| | | |