function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sathishsfdcsathishsfdc 

get the date.now value in apex for a cookie

I need to get the button clicked time of the cookie inside an apex class.How can i achieve this??
<div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="mod" onclick="WriteCookie()">Close</button>                                                
        </div>

      <script type="text/javascript">
         <!--
            function WriteCookie()
            {
               var now = system.now();
               cookievalue = escape(document.myform.customer.value) + ";"
               
               document.cookie="name=" + cookievalue;
               document.cookie = "expires=" + now.toUTCString() + ";"
               document.write ("Setting Cookies : " + "name=" + cookievalue );
            }
         
      </script>

How can i get the values inside an apex class including the time on which the button was clicked..
Thanks
bob_buzzardbob_buzzard
I think cookies are only supported in force.com sites and have to be set by the controller, not on the client.

This is a convoluted way of doing things though - if you want to send this information back to the controller why not use a hidden input field and let the platform do the lifting?