Marco's Blog

All content personal opinions or work.
en eo

How Do I Get My Content Back?

2009-01-10 2 min read Joomla marco

Have you ever done that? Created a content item that is of sufficient length that your session expired? You hit “Save,” Joomla tells you that you are not authorized to view the resource, and you are left there with a giant blog entry that is gone for good. You think.

I had that problem several times. Joomla could react a lot better to a session timeout than by making you lose hours of work, wouldn’t you think? It’s easy enough to fix, too. But we are not going to change the Joomla code right now just to find a fix from this impasse.

What can we do right here and now to save our content? Here is a short howto with a method that might work for you, just as it saved me from a bind several times.

The first thing you need to do is nothing. Don’t panic, don’t mess around with the browser. Because if you hit refresh, the browser will still remember what you were submitting, and you can re-submit it without a problem.

Unfortunately for us, Joomla sends two tokens of authentication: a cookie (which you could refresh by logging on in a different window) and a form token (which gets sent with your request and cannot be refreshed this way). Maybe your token is still valid, and it’s only the cookie that expired! Just open a new tab, navigate to the site you were posting to, log in. Go back to the tab from which you submitted the form and hit refresh. Maybe that’s the end of the story for you now.

If that didn’t work, we need to use some more advanced technology. I typically use a “wire sniffer” for this kind of purpose, but a listening proxy would work just as well.

I installed Wireshark, a really useful program that allows you to sniff traffic on your computer. Once started, Wireshark records everything that’s going on on your network. If you start it and refresh the browser from which you made the content submission, Wireshark will record that submission.