Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "cache and cookies"
-
Well... I had in over 15 years of programming a lot of PHP / HTML projects where I asked myself: What psychopath could have written this?
(PHP haters: Just go trolling somewhere else...)
In my current project I've "inherited" a project which was running around ~ 15 years. Code Base looked solid to me... (Article system for ERP, huge company / branches system, lot of other modules for internal use... All in all: Not small.)
The original goal was to port to PHP 7 and to give it a fresh layout. Seemed doable...
The first days passed by - porting to an asset system, cleaning up the base system (login / logout / session & cookies... you know the drill).
And that was where it all went haywire.
I really have no clue how someone could have been so ignorant to not even think twice before setting cookies or doing other "header related" stuff without at least checking the result codes...
Basically the authentication / permission system was fully fucked up. It relied on redirecting the user via header modification to the login page with an error set in a GET variable...
Uh boy. That ain't funny.
Ported to session flash messages, checked if headers were sent, hard exit otherwise - redirect.
But then I got to the first layers of the whole "OOP class" related shit...
It's basically "whack a mole".
Whoever wrote this, was as dumb and as ignorant to build up a daisy chain of commands for fixing corner cases of corner cases of the regular command... If you don't understand what I mean, take the following example:
Permissions are based on group (accumulation of single permissions) and single permissions - to get all permissions from a user, you need to fetch both and build a unique array.
Well... The "names" for permissions are not unique. I'd never expected to be someone to be so stupid. Yes. You could have two permissions name "article_search" - while relying on uniqueness.
All in all all permissions are fetched once for lifetime of script and stored to a cache...
To fix this corner case… There is another function that fetches the results from the cache and returns simply "one" of the rights (getting permission array).
In case you need to get the ID of the other (yes... two identifiers used in the project for permissions - name and ID (auto increment key))...
Let's write another function on top of the function on top of the function.
My brain is seriously in deep fried mode.
Untangling this mess is basically like getting pumped up with pain killers and trying to solve logic riddles - it just doesn't work....
So... From redesigning and porting from PHP 7 I'm basically rewriting the whole base system to MVC, porting and touching every script, untangling this dumb shit of "functions" / "OOP" [or whatever you call this garbage] and then hoping everything works...
A huge thanks to AURA. http://auraphp.com/
It's incredibily useful in this case, as it has no dependencies and makes it very easy to get a solid ground without writing a whole framework by myself.
Amen.2 -
Doing the Full Stack Nanodegree from Udacity
Using Google's oAuth Sign in in my Flask App, I realized that no matter what browser I use, I was unable to logout, Google always threw an error my way. I figured something must be wrong with my code..
Searched on Google, couldn't find anything relevant, gave up on first 4 results(not pages, yeah I'm that lazy!)
Spent 3 hours Debugging at different points, removing all the abstraction I've put in using various libraries (Bad move)
Finally it dawned on to me to check Udacity forum as well. It's a frickin cache/cookie thing. Tried the app in an incognito window, worked like a charm. Reverted code back with all the libraries, worked like a charm again!
FUCK YOU GOOGLE! In your attempts to track users, you're even making our work difficult!
(in hindsight, I should probably be better at asking/looking for help)1 -
My internet connection is so messed up. Again certain websites are not loading on my Mac but they are loading on my phone using WiFi. I tried clearing cookies, flushing DNS cache and changing DNS servers to OpenDNS or Google DNS.8
-
WOW! WENDY! YOU ARE THE BEST TECH SUPPORT EVER!
So on my assignment i see a glitch in the course where i cannot get access to the last button.
i contact tech support
me: Hello *explains the situation*
maddie: *please wait i will check on that*
maddie: *are you logged in?*
me: OF COURSE I AM LOGGED IN THEN HOW WOULD I BE TALKING TO U???
maddie: will it be okay if i impersonate as you?
me: w h a t
me: *session timed out* JUST WOW!
next support: > Wendy
me: explains the whole situation and sends screenshot
Wendy: ah i see. wait on that a second
me: *waits ONE HOUR*
Wendy: Please clear your cache and cookies.
what does cache and cookies have to do with a html course bug that blocks access to the last button...
well i guess you can say im stuck in the mud
i can't get out and im stranded i miss maddie the tech support because i got timed out and she was about to spill the real tea but dummy wendy popped up and is talking about cache and cookies LOL5 -
Everyone in the world can browse to my client's website on every browser. I can get to my client's website on every browser EXCEPT Chrome even on mobile devices. Doesn't even work in Incognito mode, nor after flushing cookies, cache, and history. Just the annoying ERR_CONNECTION_TIMED_OUT. And then I switch over to another Chrome profile I have and it's all fine. Google Forums are completely non-helpful because they all say it's ipconfig /flushdns or reinstall All The Things and delete and re-create my whole profile. Things like this make me want to flush Chrome forever.3
-
What creates these files and folders?
Cache, GPUCache, Local Storage, Cookies, etc...
I see that many different programs have a folder in my appdata with these exact files/file structures in it. Is there some sort of framework that creates these? I'm just curious.4