0

I m in a situation where i need to pass a larger number of values but without using POST

I can not use POST because when clicked on Browser back button sometime I get 'Webpage has expired'.

To overcome this i took help of Cookies like this

  AppFrame.setCookie("EmailInvoiceIds", ids.join(','), 1);
  window.location = "?isEmail=true&eid=1&template=2+"/#/customer/email";

Then in other Jquery i get cookies data like this

 var emailInvoiceIds = AppFrame.getCookie("EmailInvoiceIds");

but this get flopped when data size increases 4K limit of cookie

So is there any other way i can pass large data values without using POST

Please suggest

1 Answer 1

1

You should use either "GET" or "POST". There is no other option in HTTP protocol. Since the request hold bigger data length, I would suggest go with "POST" only. "Page expire" is happening to avoid posting duplicate data. And you can avoid it, making your post operation by using AJAX instead of form submission.

Sign up to request clarification or add additional context in comments.

10 Comments

Thanks for you reply...but AJAX POST just post, i want to redirect to that page as well...i need that large data on that page..
You have to do set location.href = <someurl> in success callback of ajax. Alternatively you can use location.replace(<someurl>).
And to populate data on destination page, read the posted data(which is stored in database) from database and generate page for <someurl>. Hopefully I am making sense.
see i have a grid with 1000 records, selecting all, generate a large list if ids, need to send to another url which use those ids to generate another list of records...so i need this ids on that page to which i m redirecting...
can i use some session variable in jquery?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.