Modify session tracking using wsadmin
Overview
The following example configures the session management of a Web container for session tracking...
Using Jacl:
### Identify the appserver and assign it to the server variable... set server [$AdminConfig getid /Cell:cell/Node:node/Server:server/] ### Identify the session management belonging to the server and assign it ### to the smgr variable... set smgr [$AdminConfig list SessionManager $server] ### Enable cookies and modify cookie setting... $AdminConfig modify $smgr {{enableCookies true} \ {defaultCookieSettings {{maximumAge 10}}}} ### Enable protocol switch rewriting... $AdminConfig modify $smgr {{enableProtocolSwitchRewriting true} \ {enableUrlRewriting false} \ {enableSSLTracking false}} ### Enable URL rewriting... $AdminConfig modify $smgr {{enableUrlRewriting true} \ {enableProtocolSwitchRewriting false} \ {enableSSLTracking false}} ### Enable SSL tracking... $AdminConfig modify $smgr {{enableSSLTracking true} \ {enableProtocolSwitchRewriting false} \ {enableUrlRewriting false}} $AdminConfig save
Using Jython
server = AdminConfig.getid('/Cell:cell/Node:node/Server:server/') print server smgr = AdminConfig.list('SessionManager', server) print smgr AdminConfig.modify(smgr, [['enableCookies', 'true'], ['defaultCookieSettings', [['maximumAge', 10]]]]) AdminConfig.modify(smgr, [['enableProtocolSwitchRewriting', 'true'], ['enableUrlRewriting', 'false'], ['enableSSLTracking', 'false']]) AdminConfig.modify(smgr, [['enableUrlRewriting', 'true'], ['enableProtocolSwitchRewriting', 'false'], ['enableSSLTracking', 'false']]) AdminConfig.modify(smgr, [['enableSSLTracking', 'true'], ['enableProtocolSwitchRewriting', 'false'], ['enableU lRewriting', 'false']]) AdminConfig.save()