homepage Welcome to WebmasterWorld Guest from 54.226.136.179
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Can you append cookie/session info to a URL?
What would that look like?
freshfish

10+ Year Member



 
Msg#: 7204 posted 9:53 pm on Mar 3, 2005 (gmt 0)

What would a URL that passes along session information look like?

i.e. domain.com?cfid=2222....

 

coopster

WebmasterWorld Administrator coopster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 7204 posted 11:18 pm on Mar 3, 2005 (gmt 0)

Sure, that's quite possible. It all depends on what the programmer has decided to call the session. It may also be passed along in a cookie or hidden <form> value, but you did ask about the url here I guess so we'll stick to that for now...

The default session id in PHP is PHPSESSID [php.net], so the url might look something like

http://www.example.com/PHPSESSID=als098asdf098gasj23k34l5lj23....

or something along those lines ;)

Why do you ask? Is there something in particular you are trying to figure out?

jatar_k

WebmasterWorld Administrator jatar_k us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 7204 posted 11:18 pm on Mar 3, 2005 (gmt 0)

would look pretty much like that.

the standard php one looks something like

example.com?PHPSESSID=1b56f3fd797a22cb716022b05f5db34d

which happens to be my active session id from a site right now

<added>coop has those quick fingers ;)

freshfish

10+ Year Member



 
Msg#: 7204 posted 4:39 am on Mar 4, 2005 (gmt 0)

Well, I have a script that needs to access some info on a site that has cookies. There are pages on the site that you cannot access if you do not have the cookies....so naturally the script has to somehow extract session ifno and append it to the url...or so I presume.

Elixir

10+ Year Member



 
Msg#: 7204 posted 6:49 am on Mar 4, 2005 (gmt 0)

Is the destination page outside of your site in which case the bog standard PHP cookie handling doesn't help? You might need to encode the arguments on the URL such as
example.html?arg1=value1&arg2=value2

freshfish

10+ Year Member



 
Msg#: 7204 posted 12:49 am on Mar 6, 2005 (gmt 0)

Yes, the pages are on a different site...I have u/p access to the site and am creating a script to automate some of the work that I already do there.

So, could the script mimic a session? I.e. look like a real surfer so that it can go about extracting info, etc?

Thanks

killroy

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 7204 posted 3:01 am on Mar 6, 2005 (gmt 0)

Why not just send the cookie over?

freshfish

10+ Year Member



 
Msg#: 7204 posted 6:48 pm on Mar 6, 2005 (gmt 0)

killroy...not sure what you meant by "just send the cookie over"...could you elaborate on that?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved