winwell 1 Posted February 4, 2014 Report Share Posted February 4, 2014 I am doing a bot to log into my webmail through my server but each login has a new session id which features in the URL. For example, https://blahblah.com:1234/cpsess14568747693/blah blah The cpsession changes each time I log in. To access the webmail I have to click a link but that link must contain the session id. If I could obtain the session id from the URL after I'd logged in I could do it but I can't figure out how to extract that piece of data So you login into the cpanel - Then the session id is set in the URL Need to know this to be able to include it in the URL to access webmail Anyone help? Thanks Quote Link to post Share on other sites
winwell 1 Posted February 4, 2014 Author Report Share Posted February 4, 2014 Ahhh - after more digging I think I can use $url to get the actual URL and then extract the bit I need... 1 Quote Link to post Share on other sites
winwell 1 Posted February 5, 2014 Author Report Share Posted February 5, 2014 Just incase anyone's interested in the convoluted way I did this (there'll be an easier way using JavaScript or something I'm sure)... I got the $url which contains the session id, saved it to a csv file then created a table from that csv file setting the delimiter as a '/', then set a variable as the value of the 4th column of row 0 of that table (which is the unique session id). Then I was able to construct the correct URL containing the session ID which successfully took me through to the webmail. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.