CakePHP - Session written on each page refresh - php

I have been working on project. It was working all fine before taking update. Now it stops working on my system while it is working perfectly on other's system.
Problem - it is redirecting back to login page despite dashboard, after entering correct login credentials. It is also creating a new session on refresh of page in session folder.
Any help in highly appreciated.

Related

Website inside iframe not working correctly

I have a Cakephp 2.3 website with a login system that works absolutely fine when accessed directly via its URL. Navigation between pages that don't required being logged in works, when you submit the login form with correct credentials it takes you to the restricted area, if you click on a link that requires being logged in the system recognizes that and takes you to the login page, etc.
However, when I load that same website from another website (using an iframe), the login system stops working. If you submit the login form, even with the correct credentials, it takes you back to the login page. If you try to access a restricted page, same thing. All this without showing any failed login errors or a "you're trying to access a restricted page" message that it shows when accessing the website without an iframe. The navigation between pages that don't require being logged in does work fine though.
The iframe code is as basic as it gets: <iframe src="https://mywebsite.com/" width="100%" height="700" frameborder="0"></iframe>
I've been dong some research and I can't figure out what's going on. I've tried enabling CORS just in case, because both websites are on different domains (same server), but that didn't make a difference. I don't have any code on the website, as far as I know, that would cause this. Both websites are loaded via https.
Any ideas of what could be going on?

Laravel Login Issue - Session Cookies Not Passed?

First - coming back to this project - never saw this issue before so asking if anybody else has - when I set the project down it was working perfectly. Additionally - several other projects on the same server using the same setup are working flawlessly.
So problem is this.
I login, the login is valid (I'm using DirectoryTree/Laravel to authenticate against LDAP, and have logs showing authentication was successful. All other projects are also using DirectoryTree/Laravel - and since the login is processing I cant see this being the root cause).
I'm immediately redirected back to the / (correct behavior) - but the login form returns instead of loading the vue components when auth:check = true.
I can hard refresh the page - and suddenly I'm logged in. (Must clear cache hard refresh at the browser) same action whether on Firefox, Chrome, Edge. The log in is processed - but its like the session isnt being updated.
I'm using the normal login form with the ui:auth setup.
Anybody ever seen this?
Turns out the issue was a web service worker I had forgotten I had on the HTTPS site. Best guess is its not recognizing that the site is online and is reloading information from the cache as it is a PWA application meant to be used on the internal network of the company. Once I removed the service worker - all was good. Never saw this action from it before so will investigate that further, but I have at least found the main error.
Closing this question and shout out to #Wesley Smith for getting my brain working.

Laravel 5.4 Keeps Logging user out

After anytime I move between pages or reload the same page it logs the user out. It worked fine in 5.2 but when I upgraded to 5.4 this problem appeared. I don't know what to provide because I just used:
php artisan make:Auth
and made my front end the way I wanted it. It is connected to my database remotely and it works because if I put in bad information it does not work. When it logs me in it redirects me, I see my
{{Auth:check()}}
working fine because I see new links that weren't there when I wasn't logged in. However, anytime I move between any of my pages my naviagation bar goes back to if the user wasn't logged in. It seems as if it is not carrying the session information between pages.

Yii Login routing issue

I have following problem.
My project in Yii uses standard authentication and RBAC system.
If user is not logged it and visit link like
https://domain.com/product/update?id=1234
he will be automatically redirected to homepage
https://domain.com/site/index
to process login.
After he logs in he still will be redirected at the right site (/product/update?id=1234). The problem is, that external software like MS Excel tries to pre-open the page itself and automatically changes to link to https://domain.com/site/index.
So what I need, is that link should always be the same.
That means if user visit /product/update?id=1234, then application should stay on /product/update?id=1234, but show to login form and after login stay on /product/update?id=1234.
I can not understand if it is kind of server routing issue (we are using Nginx) or it could be configuration in Yii or that need some more functionality that Yii doesn't have. Has someone already issued the same problem and can help me with solution? Any help is appreciated.

Login with facebook using php sdk not working

I'm using facebook's php sdk for a login system on localhost. It was working fine without any problems. But when i try to login now, after clicking the login button it just brings me back to the same page without actually logging me in and changes the url to something like this:
http://localhost/test.php?code=AQA6J5GuQQFCpc9mkOOmuR2...etc
I have double-checked all the code and all the source php sdk files needed. They are all there and haven't been changed from the last time i was able to successfully login. But for some reason it isn't working. Can someone please help me out.
As far as I can see Facebook requires the registration of your web site for the ap, to prevent hackers.
Therefore I don't think it can ever work if your running it on localhost, it would have to run on a domain name.

Categories