S2OJ/uoj/1/app/models
Masco Skray 923e1e61f8 fix(uoj/1/app/models): session issue caused by wrong cookie domain
After we changed the detection of the real httpHost value, the token check will fail when register.
A long time ago we just simply added "Session_Start();" at the beginning of uoj/1/app/index.php.
It temporally solved the problem but caused another series of issues that we can't see outside.
There is also a session_start() when executing Session::init() at importing app/libs/uoj-lib.php.
So, when we add one more "Session_Start();" it will execute this one more time, just cause warning:
> session_name(): Cannot change session name when session is active
> PHP Warning:  ini_set(): A session is active. You cannot change the session module's ini settings at this time
And, the session name and session path, session domain will not be set so may cause other problems.
The reason is that using UOJContext::httpHost() as web hostname when default, it will add the port at the end.
When using IP the validateIP() will return false, or using domain with port the cookie domain will be set wrongly.
As a result the register process throws out the "Expired" error and refuses to register, and other uses token will fail too.
We made it cut out the port when setting cookie domain, and also changed the style of UOJContext::httpHost() to make it easier to read.
With this problem known and solved the "Session_Start();" in index.php will also say bye-bye, and there will be no multiple session_start()s.

NOTICE: If you have set all your information to yours in .config.php, and not using address with port other than 80, you may not face this problem.
But the warning of php will consistently shown in the error log file. So kick the annoying warning information out if you are angry with this ;-)
2018-10-11 18:46:58 +08:00
..
Auth.php Initial commit 2018-09-20 17:21:40 +08:00
Cookie.php Initial commit 2018-09-20 17:21:40 +08:00
DB.php style(uoj/1/app/models): a little modify of db connection 2018-09-20 19:49:26 +08:00
HTML.php Initial commit for PHP7 2018-09-20 17:38:09 +08:00
Paginator.php update: fetch commits from upstream 2018-09-20 19:34:38 +08:00
Route.php Initial commit for PHP7 2018-09-20 17:38:09 +08:00
Session.php Initial commit 2018-09-20 17:21:40 +08:00
UOJBlogEditor.php Initial commit 2018-09-20 17:21:40 +08:00
UOJConfig.php Initial commit 2018-09-20 17:21:40 +08:00
UOJContext.php fix(uoj/1/app/models): session issue caused by wrong cookie domain 2018-10-11 18:46:58 +08:00
UOJLocale.php Initial commit 2018-09-20 17:21:40 +08:00
UOJMail.php Initial commit 2018-09-20 17:21:40 +08:00
UOJTime.php Initial commit 2018-09-20 17:21:40 +08:00
Upgrader.php Initial commit 2018-09-20 17:21:40 +08:00