Results 1 to 9 of 9

Thread: Quick Question, Please Help...

  1. #1

    Thread Starter
    Hyperactive Member Dodger's Avatar
    Join Date
    Mar 2001
    Posts
    433

    Quick Question, Please Help...

    Hey All,

    How do I get rid of the querystring of a URL?

    eg:
    ===
    Intead of www.mysite.com/default.asp?name=dodger&age=1

    Rather just www.mysite.com/registered/ (or similar)

    Any Ideas?

    Thanks.

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    You need to store the information somehow. You can use cookies or session variables or pass it in form data from page to page. But you have to somehow know that the person is a valid user in order to stop using querystrings.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  3. #3

    Thread Starter
    Hyperactive Member Dodger's Avatar
    Join Date
    Mar 2001
    Posts
    433
    Thanks,

    What are the disadvantages of using the session object? (if any)

    And why don't more sites store querystring info in the session object, in order to shorten url strings?

  4. #4
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Querystrings do have size limitations. Most sites don't bother to shorten the size because the data does not need to be secure. Candidates for a Session object variable would be a userID. But even that can be stored on a client computer using cookies and read in on each page.

    The problem with the session object is:

    1) It uses server resources. This may seem insignificant at first, but suppose you have 1000 connections being handled at the same time?

    2) It prevents an application from scaling. The session object is local to the server you are connected to. If you are using load balancing across multiple servers, the session object variable will only be in scope if the user happens to get the same server twice.

    It depends on the scale of your application now and in the future as to whether or not to use session object variables.

    One thing you never want to do is put objects in the session object. While you can, this invokes problem #1 big time. If you for instance, put a connection object into a session object variable. That connection object will be active and using memory until the user logs off (lets face it, how many of us actually log off versus just moving to a different site) or the session times out. Multiply that memory usage by the number of concurrent users and you have a server resource issue.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  5. #5
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Set Form Action to "POST". This'll send it through the HTTP header, although I'm assuming you already know this...

    So why am I posting...
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  6. #6

    Thread Starter
    Hyperactive Member Dodger's Avatar
    Join Date
    Mar 2001
    Posts
    433
    Thanks Guys.

    So where do you think I should store variables then?

    I don't really like the idea of cookies, because of the fact that not all users have them enabled, and as you say, using the session object can be very hard on the server. And ofcourse, the whole purpose of this post was to avoid using the querystring...

    Ahh! I hate computers!...

    Are there any other methods?

    Can't you just submit the form values to the asp script and have it query the db and authenticate?...no?...ok....

    Thanks.

  7. #7
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    Well, you've just run into a conceptual problem that... well... you've just realized that man is re-inventing the wheel.

    Okay...

    In the early days you would sit down at your stand alone computer and connect to the server (mainframe) via a telnet type application (rlogin/TN3270). You would work with the application on the server as a user.

    Then came the age of stupid, single user machines running rampant and plaguing peoples minds with the notion that machines should be single user.

    Someone built the web to share information, it was not conceived as a medium to run a completely interactive application. But someone figured, why not? It does have its advantages, the graphic front end is handled by the client machine, not the server machine. That reduces the server's load. But there is not a live connection, it is back and forth in posts.

    What you need is a technology that we've had around for a long time.

    You can telnet into a Unix/Linux box and redirect the display to your local machine. Then you can have your silly GUI and run a program on the remote machine.

    This does require more server resources and bandwidth than the web solution, but it offers security (SSH) and provides you with a real, live connection.

    Aside from that...

    Create a Java application in your web page. That application can connect to a port on the server and keep a live connection open. The client machine does the graphic work and runs the program, the server machine just handles the occasional communication with the Java client.

    I could start bitching now, but I won't.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

  8. #8
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    CiberThug... lay off the expresso dude.. lol

    Dodger: It depends on when you need the data and where you collect it. If you are getting it from a form and then simply passing it to the next page only, you can just set the method on your form on page 1 to POST instead of GET. If this is data you are going to need throughout your application, store it in a session object on the 2nd page.

    I'd need to know a little more specifics on what your doing to be able to give you a better answer as to which road to take.

    Problem with cookies is, if someone is paranoid enough to turn them off, they probably also turned off memory cookies, so that will kill being able to use the session object. The session object sets a temporary memory cookie on the client browser that holds the session id of the user so the server knows who is who when receiving requests. If it can't set that temp. cookie, the server can't create a session for the user.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  9. #9

    Thread Starter
    Hyperactive Member Dodger's Avatar
    Join Date
    Mar 2001
    Posts
    433
    Thanks Guys,

    I'll post again when I am ready to tackle the problem.
    (I'm just looking ahead as usual...)

Posting Permissions

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



Click Here to Expand Forum to Full Width