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

Silverstripe session on login.


Go to End


2 Posts   994 Views

Avatar
programmerswe

Community Member, 8 Posts

16 March 2016 at 10:58pm

Hi!
I'm wondering about the sessions started with silverstripe login. There is a sessions containing the logged in username? And if so, what should that be / how can i see what it is. I would like to use it so the the server know what to display on a service call.
Cheers!

Avatar
martimiz

Forum Moderator, 1391 Posts

17 March 2016 at 10:18am

You shouldn't have to query the session at all, you can get all info from the Member class:

https://docs.silverstripe.org/en/3.3/developer_guides/security/member/

You can find the current user with something like:

If ($member = Member::currentUser()) return $member->getName();