• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clicking a link versus using the address bar

#1
[eluser]cassowary[/eluser]
Hello,
I am maintaining a CI application developed by a variety of people over the past two years.
Right now I am addressing a user requirement involving the authentication of a site visitor based on data in his URL. Sometimes this code works; sometimes it doesn't.

The most puzzling thing I'm dealing with is the different behaviour of the code when I click a link (i.e. an anchor to URL A) in a page and when I explicitly try to load the same page at URL A by placing this into the address bar of the browser. In the first instance, I'm able to invoke the authentication code; in the latter case, it seems to fall through. It's almost as if, when I use the address bar to load the page (and, one assumes, short-cuts in the browser favourites) I am invoking different code to when I click upon a link to the self-same page.

I'm sorry if that sounds garbled. Can anyone elucidate matters?

Cassowary

#2
[eluser]LuckyFella73[/eluser]
In case the link you have to klick at is a form-submit there could
be some hidden input fields neccessary for authentification.

An other thing that come to my mind: maybe the page you access need
some cookie information which may not be set when pasting the url
into your browser field.

#3
[eluser]cassowary[/eluser]
That may be of some help. Are you saying that, when a URL is explicitly pasted into the address bar, that cookie information for that page is NOT sent? Is there anywhere else where I can verify this claim? I just want to be sure I'm not barking up the wrong tree. It may be a red herring in this case, though (if you'll forgive my mixing of metaphors).

#4
[eluser]Joshua Logsdon[/eluser]
Be sure to clear your browser cache, including cookies and sessions, with the kind of issues you are having so you have a "clean slate" when testing.

I don't think that a click vs a paste (unless the click url has some bad characters somewhere) should matter. It would matter though if you tried one, some session or cookie info gets set, and then you try the other, which may be using the same session or cookie info.

My next step would be dumping the data passed to the controller to look for differences.

#5
[eluser]cassowary[/eluser]
Thanks for your suggestions. However I've tried resetting the cache and browser history and removed the cookies. I still get the same problem of inconsistent behaviour according as whether I'm clicking a link or using the URL. I've done this on both IE 7 and Firefox. It's most confusing.

#6
[eluser]Joshua Logsdon[/eluser]
What a pain, huh?

That's when my next step would be breaking down data in the controller to make sure the same things are happening using each method. I feel like you are going to find the issue there but it is going to take time to go through and make those break points to find where the difference is.

#7
[eluser]andrewtheandroid[/eluser]
Just reading the description just to paraphrase, you click on the link and it works. you then copy and paste the url and put it directly into the browser and it does not work?

The only thing that springs to mind is the form validator of the receiving end is using GET data from the url. using the "?name=this&validation=that"

AFAIK when you click on a link there are is no hidden information.... unless the link is the submit for a form on that page and submits some hidden form fields. maybe there is some sort of javascript onclick submit a hidden form funny business going on?

have you looked at the source code of the page and checked if it contains a form?

Also you have comfirmed that the href="xxxx" is equal to the one you are pasting?

Sorry if the last two questions seem obvious you probably already have checked these but just in case (that's what i'd do).


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.