17452 Posts in 4473 Topics by 1971 members
|Go to End|
27 March 2008 at 2:03am Last edited: 27 March 2008 2:03am
I'm trying to integrate Silverstripe into an already existing website to see whether we can replace the existing front-end with Silverstripe. I'm quite stuck at the moment.
Existing website is living in the doc-root.
Silverstripe is living in it's own alias (e.g. /stripe)
I added a rewrite-base to silverstripe's .htaccess :
All pages and stuff work perfectly ; the problem arises when logging in to the CMS :
- Ends up at www.mysite.com/stripe/Security/Login and it displays the login form
- if I enter incorrect credentials , It displays the correct error-message
- If I enter correct credentials , it tries to do something but ends up just doing a page refresh. I did not get logged in.
Problem is ; I loose my session after a couple of clicks in the backend interface (you have been logged out of the CMS bla bla)....
This problably has something to do with cookies and security , but I cannot for the life of me figure it out...
I'm hoping someone here has an idea or even tried doing the same thing. Thanks in advance.
27 March 2008 at 11:19pm Last edited: 28 March 2008 10:02am
When starting a session , Silverstripe tells PHP to send a cookie with the current Base-URL as the cookie path. This is all good , but in my situation I want the cookie to be set at the root (/) so it works for the entire domain.
I tried setting the baseURL in the config by calling Director::setBaseURL("/") , but doing that gives me a very nasty and weird error ...
I ended up editing the sapphire/core/session class forcing Silverstripe to create the cookie for the entire domain (/).
28 March 2008 at 10:03am
Nope.. I thought I fixed it , but I didn't...
I randomly get logged out of Silverstripe ..... the cookie is set at the top level (/)....
18 April 2008 at 3:24am
I replaced the function protcolAndHost() in sapphire/core/control/Director.php so it returns a fixed value (my domain name and protcol e.g: http:www.blabla.com )...
At least silverstripe produces the right paths now....
18 April 2008 at 8:57pm
To continue this story...
The site is up and running (live), but now I have a new problem.
As long as you do not log in to the CMS , the site runs fine. Once you log-in and start working in the CMS , the system will function properly at first. After a couple of actions (saving pages / deleting pages / clicking around in the site-tree) , the system slows down to a crawl (only for the current user, the rest of the world can still perfectly use the site). It will still continue to function , but excruciatingly slow (I'm talking minutes for all actions : creating pages / moving pages / viewing a draft page).
My guess is something is going wrong with the load-balancer and sessions , but I can't get my head around it.
|Go to Top|