Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Member::currentUser() gets 'lost' for .htaccess secured calls


Go to End


2 Posts   784 Views

Avatar
esakrielaart

Community Member, 59 Posts

10 December 2014 at 7:27am

Hi all,

I have a specific problem, in which the Member::currentUser() object return empty (even when a user is properly logged in) at any moment that I try to gather a resource from a folder that is secured with a .htaccess restriction. This only occurs on the live production server, not on the localhost development server. Can somebody point out a possible cause for this? Can it have to do with sessions or similar?

The starting point of my code is the secure-assets module (SS3+). I already tested and found that during navigation on the live server, when logged in, the Member-object does not get lost (except for the situation as described above).

Hoping somebody recognizes this issue and can help me out!

Sincerely,
Maurice

Avatar
esakrielaart

Community Member, 59 Posts

14 December 2014 at 2:24am

Additional info: when appending the request URL with a '?' the member object is found. Maybe this can point anybody in the direction?

Kind regards,
Maurice