User session overwritten when using multiple forum in a same domain

Technical Support
  • Hi I'm newbie.
    What I'm trying to do is using multiple forum in a same domain.

    I installed 2 nodebb in seperate directory with different port, different redis db.
    and then set nginx.conf like below.

        location /us/ {
                proxy_pass http://127.0.0.1:4567/us/;
        }
        location /others/ {
                proxy_pass http://127.0.0.1:4568/others/;
        }
    

    Now I can run 2 forums in same domain. However If I logged in the other forum's, session overwritten.

    Is there any way that I can use seperate browser session using same domain different dir path?

    Thanks.
    http://domain.com/us/, http://domain.com/others/

  • src/admin/setting/advanced.tpl

    		<div class="form-group">
    			<label for="cookiePath">Set path for session cookie</label>
    			<input class="form-control" id="cookiePath" type="text" placeholder="/path" data-field="cookiePath" /><br />
    			<p class="help-block">
    				Leave blank for default
    			</p>
    		</div>
    

    src/middleware/index.js

    if (meta.config.cookiePath) {
    	cookie.path = meta.config.cookiePath;
    }
    

    I just solved by adding cookiePath..
    If there are better solutions, let me know! 😄

  • What's url set in both forums? Not sure if this is the reason why, but cookiePath is one solution, yes.

  • Could you submit a PR for this please? 🙂

    Also, is your secret in config.json the same, I vaguely remember having an issue with that before (I could be way off here)

  • @psychobunny just a surguestion. But would if be possible of having this(all the possible config stuff) all documented in the documentation?


Suggested Topics