Avatar of fayeb
fayeb
 asked on

cookies

I have a multi value dialog list called 'Roles' this does a look up of all the user roles available in the ACL.  A user will then select which roles they want to and submit the form.  On submission this should call the javascript to set the cookie value.

The cookie value will need to store the roles the user has selected in 'Roles' field.  There will then be a field called 'EffectiveRoles' stored on all the forms in the database which will need to get the values of the 'Roles' field stored in the cookie.  If the cookies is empty ie the user has not submitted the form then the field will be set to @UserRoles.

I need to know how to set the multi values of the 'Roles' field in the cookie and then retrieve them in the 'EffectiveRoles' field.
Lotus IBM

Avatar of undefined
Last Comment
Zvonko

8/22/2022 - Mon
AndrewJayPollack

why do that at all?  Why not just use @UserRoles on all the forms?  Storing them locally allows them to be hacked by a smart user.
fayeb

ASKER
The customer wants the user to be able to select what roles they would like to use.  It's whats been asked for!
fayeb

ASKER
All I need to know is how do i read the values from a multivalue field and set them in the cookie e.g. Roles=[role1],[role2];
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
HemanthaKumar

In cookie, seperate roles by comma

~Hemanth
fayeb

ASKER
Whats the javascript that does this?
ASKER CERTIFIED SOLUTION
Zvonko

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
fayeb

ASKER
Thanks this is exactly what I needed.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Zvonko

You are welcome :-)