Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <apex:page sidebar="false" controller="demo2Controller" action="{!directlogin}" showheader="false" standardStylesheets="false">
- function submitbtn(){
- var username = $("[id$='username']").val();
- var password = $("[id$='password']").val();
- if($("[id$='UserPass']").is(":checked")){
- $.cookie('apex__username', username, { expires: 14 });
- $.cookie('apex__password', password, { expires: 14 });
- $.cookie('apex__remember', true, { expires: 14 });
- }
- else if($("[id$='directlogin']").is(":checked"))
- {
- $.cookie('apex__username', username, { expires: 14 });
- $.cookie('apex__password', password, { expires: 14 });
- $.cookie('apex__directlogin', true, { expires: 14 });
- }
- console.log($.cookie("apex__password"));
- console.log(CryptoJS.MD5(password));
- //here we have to encrypt the password.
- $.cookie('apex__encryptpassword', CryptoJS.MD5(password), { expires: 14 });
- controllerMethod();
- }
- public PageReference directlogin(){
- Cookie getPass = ApexPages.currentPage().getCookies().get('encryptpassword');
- password = getPass.getValue();
- //here we have to decrypt the password.
- }
Add Comment
Please, Sign In to add comment