Session Error - Permission denied - sites at different ports

Asked

Viewed 134 times

1

Hello, good afternoon, sir. I’ve been trying to solve this problem for some time: I have a website that runs on the standard door and an administrative system that runs on port 8080. (ex: https://www.dominio.com.br and http://www.dominio.com.br:8080/Adm )

When in the same browser, I log into the site of port :8080 and then on the site of the standard port, it does the process normally, ends with the session generated by port :8080 and generates a new one. When I try the reverse process, log in through the standard port and then in :8080, I get the following error:

Warning: session_start() [Function.Session-start]: open(C: xx sess_malaee35psko2uv3rsjhmfd0e3, O_RDWR) failed: Permission denied (13) in C: xx xx login.php on line 2

In both systems, the web user is used, in one I can access the session and in the other not. I searched the foruns a lot and found nothing concerning the question of the doors and the error of permission. I changed the permission of the session directory to 777 and no longer had the error, however, as the access comes from the same place, for the same place, I would like to know the reason of this, on one side manage to erase and on the other not.

Thanks in advance for your attention.

1 answer

2

Probably using or php-built in server, probably the way you set up PHP the session should be trying to write in c:\windows\temp but IIS is not running with administrator privileges, to resolve just point a folder "does not publish" to save the session, you can configure this in php.ini as explained in Error write failed: No space left on device

Switch in php.ini to something like (the folder outra-pasta/pastadetemporarios must exist):

session.save_path = c:/outra-pasta/pastadetemporarios

Or you can adjust at the beginning of your php script:

<?php
session_save_path('c:/outra-pasta/pastadetemporarios');

The folder must be in user IIS is using (if using IIS) or else it must be in a folder which the main user who started the server

  • Yes William, iis XI. So the PHP configuration is the same for both ports and the directory is PHP/Sessions for both as well. I can generate and manipulate session on both ports, but when I try to modify the generated session on the standard port, accessing through the :8080 port I can’t (inverse I can). Access is done by the same internet user.

  • 1

    @Diegoandrade yes, because it must be using maybe a proxy-inverse or 2 servers on the same machine, however they are in different user (windows user), one of them should start in root and other not.

  • Hm, got it! I’ll check on the proxy and return here. Possibly this is the problem... About the server, it runs on it. Only the door direction that is done in different directories. Thank you Guilherme.

  • @Diegoandrade for nothing, any news just let me know ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.