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

Best Security Practice For Passing ID to controller form


Go to End


3 Posts   833 Views

Avatar
Scott Farmer

Community Member, 49 Posts

8 July 2016 at 12:36pm

Hi,

A member has bookings. Each member can update their own booking. So I am passing the ID like this:
members/update/editbooking/1300

And to load their details, filter on ID and logged in memberID (without this, any member could view any booking).

My question is this the best way to do this? Should I generate a random identifier string to pass into the URL instead so I don't expose ID's?

Thanks

Avatar
martimiz

Forum Moderator, 1391 Posts

9 July 2016 at 2:32am

As the ID is only ever exposed to the logged in user, who can only view his own bookings (a user can have multiple bookings?) the security risk isn't that big - but why not use something the member knows anyway, like an ordernumber, that is supposed to be unique as well?

Avatar
Scott Farmer

Community Member, 49 Posts

9 July 2016 at 8:49pm

Thanks for that. Will use a generated order number string to pass.