PDA

View Full Version : [Java] Help Session Holding



foreignemphasis
05-25-2016, 12:14 AM
Hi guys, i'm looking to learn how to program a neopets program in java. But i've got no clue how to hold a login session.

Any help? A demo and/or sample codes perhaps. I actually dun even know how to grab and request html pages. Lol so some help in that wld be nice.

I've only ever programmed in java for stand-alone applications processing data grabbed from ftp servers. I've no experience with programming for browser games.

Zachafer
05-25-2016, 12:31 AM
@winstonlim1992 ([Only registered and activated users can see links]) Session holding is all done by cookies. Cookies are stored locally and are sent to the server with each webrequest. The server will tell you in its response what the cookie values should be.

For example, when you login to Neo, you send a POST request containing the data username=MUNSTERPOO&password=SECUREDPASSWORD with the account's username and password. Neo's server will respond with either a success or some kind of failure message. In the case of a successful login, the response headers will have lines that look like Set-Cookie: neologin=3021e68df9a7200135725c6331369a22; or Set-Cookie: np_uniq=munsterpoo_id_8514; to indicate which account session you are connected with.

[Only registered and activated users can see links]

Keep asking questions, we like to help around here :)

Underlined words = key vocab words