I am having problems with CakePHP2.0 login sessions and cookies.
When i login from the website with “http://myweb.com” at the start, the user is only loged it if he keeps on the same URL.
If he changes to “http://www.myweb.com”, then it seems that the user is not loged in anymore and the system requieres from username and password again when he tries to add a post or something similar.
I am using CakePHP function, the one that createds by default with the “cake bake”.
Why is this happening?
Does it have any solution?
THanks.
if you add this to your bootstrap.php it should make the sign-in work with the www or not
That being said – it is always a good idea to pick a canonical url with or without the www and redirect your users to that.
You decide whether or not you want your domain to include a www and re-direct your users to that one instead of letting them decide.