Silverstripe Session not persisting, unless /admin visited - silverstripe

To replicate:
Fresh install. Place the following in Page::init().
var_dump(Session::get_all());
Session::set('testVariable', 'testValue');
Visit a page on the site, without logging in and WITHOUT visiting /admin.
The expected result of this (after loading the page twice) would be to see a dump of session data containing testVariable => testValue
Instead it seems that any data stored in the session does not persist between requests. Unless /admin has been visited. Visit /admin, then do the check again...
So something happens when /admin is visited that kicks Session into persisting.
This does not seem to be an issue on all hosting environments... however, 3/4 that we have tested on do have this issue. Two of these are running PHP 5.4, the other two PHP 5.6.
This does not seem to be an issue specific to any SS version, we've tested 3.0.5, 3.2, 3.4.0
I've submitted an issue against silverstripe-framework on github, but any insights would be valuable as we have a site in the wild that is broken because of this, any clues/fix/patch/hack/workaround would be great.

Adding Session::start(); before the other session calls works.

Try Session::save() after Session::set().

Related

Can't Install DNN 6.2.9 - 302 Redirect Loop Timeout

I'm trying to install DNN version 6.2.9 (I have to use this version for the client I'm working with), but I'm not being able to get the installer to work. I've followed all the steps at this link:
http://www.dnnsoftware.com/wiki/how-to-install-dotnetnuke
When I get to the step where I'm supposed to go to the installation wizard on localhost, step 10, the browser-based installer isn't loading. When I investigated the network traffic, it appears the installer is trapped in a 302 redirect loop and the request to the server is timing out. Below are the two urls it keeps alternating between. Any thoughts on what could be causing this? I suspect some kind of permissions or maybe db access problem, but I haven't been able to find a solution yet.
Local host prefix: localhost/dotnetnuke
Two .aspx files it keeps alternating between:
login.aspx?ReturnUrl=%2fdotnetnuke%2fInstall%2fInstallWizard.aspx
Install/InstallWizard.aspx
Are any of the database tables, stored procedures, etc. created? This is often an issue reading the PortalAlias information - so I would check that you have DB access, write permissions (the installer should do that for you anyway). If everything is created, check the portal alias table.
I would also check relevant file permissions mentioned in the guide.

Sylius Authentication failing on homepage alone

a bit of a weird
On every page except my homepage I have "Authentication: no" showing in the Symfony, but when I check other pages I am logged in as expected.
I have tried clearing cache, session, and logging in and out and it remains. I discovered this from printing app.user as I'm using it in if statements.
I have also watched logs as logging in but everything is working fine!
I'm not sure how else to debug this - I also have this issue on my production server so I'm sure its application based
if anyone can suggest anything I would appreciate the thoughts/help
thanks
Try to change you security.yml file from:
sylius.security.shop_regex: "^/(?!admin|api/.*|api$|media/.*)[^/]++"
To
sylius.security.shop_regex: "^/(?!admin|api/.*|api$|media/.*)"
I'm using Sylius 1.1.1
Did you remove the localised urls? Please check the sylius.security.shop_regex settings:
http://docs.sylius.org/en/latest/cookbook/disabling-localised-urls.html

login failure with symfony, still redirected

I am building a Symfony2 project, using FosUserbundle and have a serious security issue. When a user tries to connect, it correctly redirects to the home page when the credentials are correct, but most of the time without actually loading the user, still with the anonymous token, not logged.
It sometimes logs me successfully at the first try, usually after 2-4 attempts, sometimes more. It seems to fail 70 to 80% of the time.
There is no error message at all, everything seems to work just fine, except it doesn't. I cloned my project without FosUser, using the login and security system in the cookbook in the documentation on the Symfony website, still the same.
The application has been developed with Symfony 2.3, but upgrading to 2.6 and 2.7 doesn't solve the problem.
The security code is completely vanilla except to extends my template in one twig file, and the behaviour is still the same without the extends.
The config files have been modified according to the FosUserBundle doc.
I am obviously missing something, but no idea what.
After a couple of week, it stopped doing weird stuff, that is good, but no idea why, that is not so good.
As i have said, the config files are straight out off the official doc. If they were at fault, i think that dozens would have had the same issue.
For the curious, it started doing weird stuff while i was playing with websockets and Ratchet. I don't know if it give an idea to someone as to the why.

plone add-on collective.sendaspdf: login required for downloading page

I'm using collective.sendaspdf for pdf download of plone pages, but it asks users to login whene they download a public content.
This appears strange as it happens just in the production server, not in the development server (the only difference seems that the latter is started in foreground mode).
Of course I can't assign particular permissions on objects to anonymous users, so I guess the problem is somewhere else
thanks to Jean's suggestion, i enabled the verbose security and the error is "Unauthorized: You are not allowed to access '##at_base_edit_view' in this context"
This looks strange to me as the page is the view of my content-type archetype-based, and it is published so it is visible to anonymous users. I repeat also that I have the development server with the same software installed where the authorization is correctly given, i.e. the page can be downloaded by anyone without login...what changes is the network configuration (I have an apache that performs some url rewriting in front of my zope server, but this just affects the path of the plone site to be hidden)
I wonder if I can manage to correct this just through the sendaspdf configuration. I don't know which additional info I could provide about the environment/configuration. I'm running Plone 4.0.4 + collective.sendaspdf 2.0
Ok, the problem was due to a bug in how collective.sendaspdf handles archetype-based content types, it's possible to workaround it by replacing the code:
view_name = context_type.getProperty('immediate_view')
with
view_name = context_type.getProperty('default_view')
in the method get_page_source of base.py, or by waiting the next release of the product.

"The Resource Cannot Be Found: /Login.aspx" on new v5.20 Install

Please see my DNN Forum Post for more details.
I've never had any issues with DotNetNuke installations. But with the new v5.20 (or v5.02, whichever it really is), everything runs perfectly fine through installation. I then get to the main default portal homepage. But as soon as I click any of the links available to continue (Home, Register or Login) I get 404 errors every time with a reference back to the applicable aspx page (Home.aspx, Register.aspx or Login.aspx.).
Windows 7, IIS7, SQL Server 2008. All permissions are setup properly on the directory and in IIS. I would think this is an IIS7 configuration issue, but I've tweaked everything in there a half-dozen times. No one at DNN is returning answers on my forum post anymore either after one guy tried.
Help!
This is something to do with the Friendly URL stuff. I found this blog post which talks about the Friendly URL Provider architecture. This made me try changing the urlFormat attribute for the DNNFriendlyUrl provider from "humanfriendly" to "searchfriendly", which made the URLs the way they used to be. I'm not sure exactly where things are going wrong and don't really have time to dig into it at the moment, but hopefully this will be helpful to get you moving again too.
With the release of DNN5 (up until 5.02.01 as of the time of writing), the friendly URL provider won't work when DotNetNuke is not on default port 80. There are different solutions floating around, but the simplest is just to replace the DNN friendly URL provider with the free one from iFinity. The installation is really simple and included in the download. Or see the following blog post:
http://www.sailer.com.au/dotnetnuke/dnn5-friendlyurl-port
Okay have you tried the 'old style' of login - domain.com/default.aspx?ctl=login
If that still doesnt work then i have to say that most likely something has happened to IIS - if so then you might just see if you can install the package you have on a different box or have a friend try a different box
I have done 2 upgrades with 5.2 and a few test installs with the Starter Kit Package and Install packages and have never seen this problem - not to say that it doesnt exist.
My next trial would be to go and redownload the install package from CodePlex and start from scratch to see if you can make the same thing happen again.
OKayone thing I dont think that has been mentioned in reading through everything is double check IIS.
My first guess without looking on your server would be to check if something happened to the 'check file exists' setting - i know this is changed in IIS7 so I cant point to the exact place to check this.
Here is a link to the IIS7 forums on it - http://forums.iis.net/t/1092696.aspx
http://forums.asp.net/t/1191083.aspx
either one might help - google also has a lot on this
Tell me how this goes in checking up on it and we can move forward from there!
you probably need to reg_iis on the version(s) of asp.net that your IIS is going to support.
http://msdn.microsoft.com/en-us/library/k6h9cz8h(VS.80).aspx
If the right version is not set up then you will get the 404 error
So placing it under port 80 works, right?
Is there a good reason not putting it under that port?

Resources