Posted comment by UGC feature in tridion: its pick the user name from the cookies, not from the Username Textbox field

218 Views Asked by At

I am working on User Generated Content feature in Tridion 2011, i have provided a option to user can give the comment on page/component.

After implementing this, User are able to submit his comments on page/component successfully. but i am facing one issue in this functionality,

Suppose, if user post the comment on page with XXX as User name and [email protected] Email address on a page and after some time if any other user open that page from same browser and give comment with different name then its submitted successfully,

But when i see these comments details in Trdion page then both comments are displayed the same user name, its does not changed the user name if any other user submitted comment on page from the same browser,

After investigating more, i found it that, the User-generated-Content in Tridion, that pick the user name from cookies. But once i have deleted the cookies of that page from browser and then its pick the current user name which user has passed in the Username Text field.

Could any one can help me, do we have any property or setting in managecomment in UGC which will pick the current user name?

<ugc:ManageComments runat="server" ItemURI="@PhysicalUri" PostParameter="addComment@{ @PhysicalUri}" UsernameParameter="one@{ @ItemID }" EmailParameter="email@{ @PhysicalUri}" EditParameter="editComment@{ @PhysicalUri}" CommentIdParameter="commentId@{ @PhysicalUri}" RemoveParameter="removeComment@{ @PhysicalUri}">
        <ugc:Comments runat="server" ItemURI="@PhysicalUri" Submitted="@Package.showunmoderatedcomments" FlaggedForModeration="true" Posted="true" Resubmitted="false">             
.....
....
<div class="grey_form">
<form method="post" id="comments@{ @ItemID }" class="grey_form">
    <fieldset>
        <div class="legend">Comment on this story</div>
        <label for="one@{ @ItemID }">Enter your name</label>
        <input type="text" id="one@{ @ItemID }" name="one@{ @ItemID }" value ="<% =MemberName@{ @ItemID } %>" ><br/>

        <label for="two@{ @ItemID }">Enter your email address</label>
        <input type="text" id="two@{ @ItemID }" name="email@{ @PhysicalUri}" value ="<% =MemberEmailAddress@{ @ItemID } %>" ><br/>

        <label for="three@{ @ItemID }">Type your comment</label>
        <textarea id="three@{ @ItemID }" name="addComment@{ @PhysicalUri}"></textarea><br/>
        <input type="submit" name="B1@{ @ItemID }" class = "button grey" value ="SUBMIT"/>
    </fieldset>
</form>
</div>  
1

There are 1 best solutions below

1
On

Anonymous users will be identified through cookies, if you are allowing anonymous users to post comments this is the behavior because you can allow visitors to edit or delete the comments they submitted themselves.

In practical scenario this will never be the case that your visitors use the same browser. You could disable anonymous access and setup visitor accounts via Audience Manager, so you can pick up the user accounts from Audience Manager.

If you still want to have anonymous and have the different usernames, workaround is as simple as implementing the javascript cookie delete function on submit click of your comments.

In case if you are planning to integrate audience manager, please take a look at http://sdllivecontent.sdl.com/LiveContent/content/en-US/SDL_Tridion_2011_SPONE/task_BD0C04660E7A449DB692B91E44A3015D