Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to persist data on client side

 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers
I am developing a web application thought of a situation as in any AJAX call we have to go to server to fetch the data, so why not to persist the data which is going to be used frequently by the user. In order to do so , I wanna to persist the data on client side. May be in XML format.
Can anyone please tell me whether it is possible to store the data on client side in the XML format. And then fetch the data from that XML and show it to client . All this should be like a blackbox to the end user. I mean user should not be aware from where exactly his/her data is fetched from.
Any white paper any link will be greatly be apprieciated.
Thanks in advance
SAmir
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Persist for what duration? For the current session you can use JavaScript. This is quite common in Ajax. If the persistence needs to span over multiple sessions you could try using cookies for this.
 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Rob,
Thanks for the reply. I want to persist my data in XML and that too across sessions. Is it not possible to save XML on client side at some perdefined location and use it as Database.
Thanks
Samir
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Web servers have no access to the local file system except through cookies. Only with techniques like (signed!) applets, OCX controls and the like is it possible.
I'm not sure but I think you can store XML in cookies. That meets all your requirements except the specified location.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd also be pretty wary of storing anything locally that could change on the server side without some sort of invalidation check.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic