Link to home
Start Free TrialLog in
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.
Avatar of AndrewJayPollack
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.
Avatar of 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!
Avatar of 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];
In cookie, seperate roles by comma

~Hemanth
Avatar of fayeb

ASKER

Whats the javascript that does this?
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fayeb

ASKER

Thanks this is exactly what I needed.
You are welcome :-)