Example: Configuring for session tracking using wsadmin
The following example configures the session management of a Web container for session tracking:
- Identify the application server and assign it to the server variable:
set server [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]Example output:
server1(cells/mycell/nodes/mynode/servers/server1:server.xml#Server_1)- Identify the session management belonging to the server and assign it to the smgr variable:
set smgr [$AdminConfig list SessionManager $server]Example output:
(cells/mycell/nodes/mynode/servers/server1:server.xml#SessionManager_1)- Modify attributes related to session tracking:
- This example command enables cookies and modifies cookie setting:
$AdminConfig modify $smgr {{enableCookies true} {defaultCookieSettings {{maximumAge 10}}}}- This example command enables protocol switch rewriting:
$AdminConfig modify $smgr {{enableProtocolSwitchRewriting true} {enableUrlRewriting false} {enableSSLTracking false}}- This example command enables URL rewriting:
$AdminConfig modify $smgr {{enableUrlRewriting true} {enableProtocolSwitchRewriting false} {enableSSLTracking false}}- This example command enables SSL tracking:
$AdminConfig modify $smgr {{enableSSLTracking true} {enableProtocolSwitchRewriting false} {enableUrlRewriting false}}
- Save the changes with the following command:
$AdminConfig save