Professional Web Applications Themes

Append session id to url - PERL Beginners

I am using Apache::Session::Mysl and I was able to generate a session id. What I want to know now is how to append that sess_id to the url as soon as it is created and as soon as the user loads the page. For example, the session is created when I go to the following url: http://localhost/cgi-bin/myrequest.pl But at this point it is not appended to the url yet. I am trying to make it seeable when I go to the page: http://localhost/cgi-bin/myrequest.pl?sess_id=000aaaa2114452221149988ac01 Any ideas?...

  1. #1

    Default Append session id to url

    I am using Apache::Session::Mysl and I was able to generate a session
    id. What I want to know now is how to append that sess_id to the url as
    soon as it is created and as soon as the user loads the page.
    For example, the session is created when I go to the following url:
    http://localhost/cgi-bin/myrequest.pl
    But at this point it is not appended to the url yet. I am trying to make
    it seeable when I go to the page:
    http://localhost/cgi-bin/myrequest.pl?sess_id=000aaaa2114452221149988ac01

    Any ideas?

    Issa Guest

  2. #2

    Default Re: Append session id to url

    Issa Mbodji wrote: 

    as a HTTP Header command -

    my $id = '000aaaa2114452221149988ac01';
    print "Location: http://localhost/cgi-bin/myrequest.pl?sess_id=$id";

    --
    _Sx_ http://youve-reached-the.endoftheinternet.org/ _____
    http://postfix.insecurity.org/
    http://jaxpm.insecurity.org/
    http://cis4dl.insecurity.org/
    http://outerlimits.insecurity.org/
    http://twilightzone.insecurity.org/
    Wc Guest

  3. #3

    Default Re: Append session id to url

    Thank you!

    org wrote:
     
    >
    > as a HTTP Header command -
    >
    > my $id = '000aaaa2114452221149988ac01';
    > print "Location: http://localhost/cgi-bin/myrequest.pl?sess_id=$id";
    >[/ref]

    Issa Guest

  4. #4

    Default Re: Append session id to url

    From: Issa Mbodji <net> 

    You may consider moving the session id to the beginning of the path
    instead of keeping it in the query. If you have the ID in the query
    you have to take good care that you do not lose it. All links in the
    HTML you create must contain it. All static HTML pages must be
    scanned and all URLs changed ...

    It realy is a big hastle and it will decrease your server's
    performance.

    IMHO it's more efficient to use URLs like this:

    http://localhost/sess_id=000aaaa2114452221149988ac01/cgi-
    bin/myrequest.pl

    That way if you use relative links you do not have to care about the
    session ID.

    See http://jenda.krynicky.cz/C/SessionID.txt. The doent describes
    a IIS filter, but the idea is valid for Apache as well and should not
    be hard to implement.

    Jenda
    ===== cz === http://Jenda.Krynicky.cz =====
    When it comes to wine, women and song, wizards are allowed
    to get drunk and croon as much as they like.
    -- Terry Pratchett in Sourcery

    Jenda Guest

  5. #5

    Default Re: Append session id to url

    Thanks, Jenda. I did not know that, but I will try it out!

    Jenda Krynicky wrote: 
    >
    > You may consider moving the session id to the beginning of the path
    > instead of keeping it in the query. If you have the ID in the query
    > you have to take good care that you do not lose it. All links in the
    > HTML you create must contain it. All static HTML pages must be
    > scanned and all URLs changed ...
    >
    > It realy is a big hastle and it will decrease your server's
    > performance.
    >
    > IMHO it's more efficient to use URLs like this:
    >
    > http://localhost/sess_id=000aaaa2114452221149988ac01/cgi-
    > bin/myrequest.pl
    >
    > That way if you use relative links you do not have to care about the
    > session ID.
    >
    > See http://jenda.krynicky.cz/C/SessionID.txt. The doent describes
    > a IIS filter, but the idea is valid for Apache as well and should not
    > be hard to implement.
    >
    > Jenda
    > ===== cz === http://Jenda.Krynicky.cz =====
    > When it comes to wine, women and song, wizards are allowed
    > to get drunk and croon as much as they like.
    > -- Terry Pratchett in Sourcery
    >
    > --
    > To unsubscribe, e-mail: org
    > For additional commands, e-mail: org
    > <http://learn.perl.org/> <http://learn.perl.org/first-response>[/ref]
    Mame Guest

Similar Threads

  1. Replies: 17
    Last Post: September 12th, 11:42 PM
  2. Append to XML
    By jgiotta in forum Macromedia ColdFusion
    Replies: 1
    Last Post: June 16th, 01:31 PM
  3. XML append DOM in other DOM
    By mik77 in forum Macromedia ColdFusion
    Replies: 2
    Last Post: June 14th, 02:31 PM
  4. PDF Append
    By Roland_Verhaaf@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 2
    Last Post: April 2nd, 09:46 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139