Konqueror Saved Sessions Location

The Konqueror web browser, which is available for Linux and Microsoft Windows systems, provides a mechanism to save and restore sessions. If Konqueror becomes unresponsive and you have to kill it, you should be given a choice to restore the previous session when you reopen the browser as shown below.

Konqueror restore session prompt

Though when I chose to restore the session above, the tab with a label beginning with "Error: Unknown Host" didn't reopen. That error message occurred when I attempted to refresh the page at a time when the system had lost network connectivity.

You can manually save a session, by clicking on File on the menu bar, then selecting Sessions, then Save As.... You will then be prompted to provide a name for the session. You can reopen a saved session by selecting File then Sessions from the menu bar and then selecting from one of the saved sessions you will see listed. If you have previously saved one or more sessions, you will see them listed under the Save As... and Manage... options as in the example below where I have two saved sessions. For both instances, I gave the sessions names matching the date on which I saved the session.

Konqueror sessions options

You can also open, rename, or delete an existing session by selecting the Manage... option.

Konqueror manage sessions

You can click on a session name to select it and then choose Open to restore the session or Delete or Rename.

When you manually save a session, on a Linux system the information is stored beneath the .kde/share/apps/konqueror/session in a user's home directory. E.g., on a CentOS 7 system, I saved a session I named "2016-07-30" for the day I saved the session, so I see a directory by that name in that location.

$ ls ~/.kde/share/apps/konqueror/sessions
2016-07-30
$

Within that directory I saw the following file:

$ ls ~/.kde/share/apps/konqueror/sessions/2016-07-30
_1.81
$

That file is an ASCII text file.

$ file _1.81
_1.81: Non-ISO extended-ASCII text, with very long lines, with LF, NEL line terminators
$

If you want to determine the number of windows that were open in the session without restoring the session, you can look for the "Number of Windows" line in the file. E.g., for another session where the file name for the stored session was _1.692, I see the following:

$ grep "Number of Windows" 2016-08-05/_1.692
Number of Windows=2
$

Each window that was open when the session was saved has a section that begins with "Windown" where n is the number of the window. The first window is Window0.

$ grep "\[Window[0-9]*\]" 2016-08-05/_1.692_1.692
[Window0]
[Window1]
$

The session file will contain lines like the following ones:

$ more _1.767
[General]
Number of Windows=1

[Window0]
FullScreen=false
Height 768=504
HistoryItemViewT0_0LocationBarURL=/usr/share/doc/HTML/index.html
HistoryItemViewT0_0StrServiceName=khtml
HistoryItemViewT0_0StrServiceType=text/html
HistoryItemViewT0_0Title=Welcome to CentOS
HistoryItemViewT0_0Url=file:///usr/share/doc/HTML/index.html
HistoryItemViewT0_1Buffer=\x00\x00\x00]file:///home/johnsmith/public_html/food/r
ecipes/shore_update/asparagus-strawberry-salad.html\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x03b\x00\x00\x01�������������\x00\x00\x00\x00\x00\x00\x00\x02������
��\x00\x00\x00\x00\x00\x00\x00d\x00\x00\x00d������������\x00��������������������
����������������\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
HistoryItemViewT0_1DoPost=false
HistoryItemViewT0_1LocationBarURL=/home/johnsmith/public_html/food/recipes/shore
_update/asparagus-strawberry-salad.html
HistoryItemViewT0_1PageReferrer=
HistoryItemViewT0_1PageSecurity=0
HistoryItemViewT0_1PostContentType=
--More--(2%)

The instances of a backslash followed by an "x" and then some digits are hexadecimal representations of characters. E.g. \x00 represents the null character.

The above lines were from a saved session with one window with 3 tabs open and another window with one tab. For the first tab, which has a "T0" in "HistoryItemView" lines, when Konqueror was opened it opened the default web page, which was the file stored at /usr/share/doc/HTML/index.html. I then opened the asparagus-strawberry-salad.html file. The "HistoryItemView" entries for a tab are in the form "HistoryItemViewTn where n is the number of the tab. I can see the history of the URLs visited for each tab by searching the file for lines containing "LocationBarURL=".

$ grep "LocationBarURL=" _1.767
HistoryItemViewT0_0LocationBarURL=/usr/share/doc/HTML/index.html
HistoryItemViewT0_1LocationBarURL=/home/johnsmith/public_html/food/recipes/shor
e_update/asparagus-strawberry-salad.html
HistoryItemViewT1_0LocationBarURL=
HistoryItemViewT1_1LocationBarURL=https://www.wikipedia.org/
HistoryItemViewT1_2LocationBarURL=https://en.wikipedia.org/wiki/HTTP_error_codes
HistoryItemViewT2_0LocationBarURL=
HistoryItemViewT2_1LocationBarURL=http://www.google.com/
HistoryItemViewT2_2LocationBarURL=http://www.google.com/search?hl=en&source=hp&b
iw=&bih=&q=centos+network+connection+not+restarting+when+system+reboots&gbv=1&oq
=centos+network+connection+not+restarting+when+system+reboots&gs_l=heirloom-hp.3
...16471.16471.0.17542.1.1.0.0.0.0.85.85.1.1.0....0...1ac..34.heirloom-hp..1.0.0
.BDFfXv9G3d8
HistoryItemViewT2_3LocationBarURL=http://serverfault.com/questions/589990/centos
-6-5-not-bringing-up-network-interface-automatically-after-reboot-ifup-et
HistoryItemViewT2_4LocationBarURL=http://serverfault.com/questions
$

The T0 entries correspond to the first tab opened when Konqueror opened. They show that an index.html file was opened and then the file asparagus-strawberry-sald.html was opened in the same tab. The T1 entries correspond to the next tab opened. I clicked on the new tab button to open that tab, so the T1_0 entry is blank. I then visited http://www.wikipedia.org in that tab and from there visited the Wikipedia page for HTTP error codes. I opened the T2 tab by clicking on the new tab button, so its first entry T2_0 also has no URL listed for the location bar URL. But then I went to Google.com and performed a search for centos network connection not restarting when system reboots, which is shown in T2_2. I then clicked on one of the links returned, which is shown in T2_3. I then cicked on another link on that page, which took me to http://serverfault.com/questions.

If I only wanted to see a list of all the URLs visited regardless of which tab they were in, I could pipe the output of the grep command into the cut command as shown below:

$ grep --only-matching "LocationBarURL=.*" _1.767 | cut -d"=" -f2
/usr/share/doc/HTML/index.html
/home/johnsmith/public_html/food/recipes/shore_update/asparagus-strawberry-salad.html

https://www.wikipedia.org/
https://en.wikipedia.org/wiki/HTTP_error_codes

http://www.google.com/
http://www.google.com/search?hl
http://serverfault.com/questions/589990/centos-6-5-not-bringing-up-network-interface-automatically-after-reboot-ifup-et
http://serverfault.com/questions

Note: the session file will even contain entries for tabs closed since Konqueror was opened.

The third tab that I opened was the one that shows the www.google.com URL. There are five URLs for that tab. The first one was blank when I opened the new tab, followed by http://www.google.com and then through http://serverfault.com/questons. But, after I visited the last URL for that tab, I backed up to the prior URL using the back button in the browser, so the http://serverfault.com/questions one wasn't the open one in that tab when I saved the session. You can determine which URL is the currently visible one even if you've moved backwards in the tab to previous URLs by searching on ^ViewT[0-9]. The "^" indicates that what follows should occur at the beginning of a line, so I'm searching for any line that begins with "ViewT" followed by any number from 0 to 9.

oreilly.com - Your tech ebook super store
$ grep "^ViewT[0-9]" _1.767
ViewT0_CurrentHistoryItem=1
ViewT0_LinkedView=false
ViewT0_LockedLocation=false
ViewT0_NumberOfHistoryItems=2
ViewT0_PassiveMode=false
ViewT0_ServiceName=khtml
ViewT0_ServiceType=text/html
ViewT0_ToggleView=false
ViewT1_CurrentHistoryItem=2
ViewT1_LinkedView=false
ViewT1_LockedLocation=false
ViewT1_NumberOfHistoryItems=3
ViewT1_PassiveMode=false
ViewT1_ServiceName=khtml
ViewT1_ServiceType=text/html
ViewT1_ToggleView=false
ViewT2_CurrentHistoryItem=3
ViewT2_LinkedView=false
ViewT2_LockedLocation=false
ViewT2_NumberOfHistoryItems=5
ViewT2_PassiveMode=false
ViewT2_ServiceName=khtml
ViewT2_ServiceType=text/html
ViewT2_ToggleView=false
$

For the T1 entries, which was the third tab I opened (they are numbered starting at 0), "ViewT2_NumberOfHistoryItems=5" indicates that 5 URLs were visited in that tab. But the current one is indicated by "ViewT2_CurrentHistoryItem=3". Since the 5 URLs are numbered from 0 to 4, that is the next to last one visited in that tab.

 

TechRabbit ad 300x250 newegg.com

Justdeals Daily Electronics Deals1x1 px