Welcome Guest, Not a member yet? Register   Sign In
Flash data not working, in Chrome only
#1

[eluser]gmoore[/eluser]
Hi all,

I'm having some issues with flashdata. Everything seems to be working in Firefox, but in Chrome (and my mobile BB browser, FWIW) it seems as if no flashdata is persisting between pages. I should note also that everything is ok when I work locally, even in Chrome. But on the production site in chrome, flashdata doesn't persist.

I've spent the better part of the evening researching the issue, but no other threads/ideas seem to do the trick. There are no 404s that could be interfering.

Would greatly appreciate any help.

Thanks!
#2

[eluser]InsiteFX[/eluser]
Try using keep_flashdata
#3

[eluser]gmoore[/eluser]
I've been using CI for quite a while now, so I'm completely familiar with how it works and how to use it (incl keep_flashdata). I'm certain the problem has nothing to do with implementation, but is a more fundamental issue.
#4

[eluser]InsiteFX[/eluser]
You are correct I just tried it in all new versions of IE FireFox and Chrome!

And it does not work...

But this is what I did, Set your session cookie to expire on close to clear out the cookie.

Load the browser, flashdata display's nothing. But if I click on the browser refresh it then shows up
this is working on all versions with a page refresh.

So it is like it needs a browser refresh for it to display!
#5

[eluser]gmoore[/eluser]
I tried what you described and still not getting anything. Besides, this shouldn't be required in practice. Any other ideas?
#6

[eluser]gmoore[/eluser]
Here's a strange development. I've been doing some debugging, and I'm observing that MY_controller is being called multiple times on any given request. I dug a bit deeper, and it seems like this extra call is in the context of a page class that I have (but which should have nothing to do with the request being made). When I check Codeigniter.php, it appears that it's looking for class "page" and method "favicon.ico." Why would the favicon be prompting a method call??


With this phantom call to page class happening between actual requests, i can definitely see how flashdata would get messed up.
#7

[eluser]Aken[/eluser]
Some browsers try to load the favicon by default, even if its not in your HTML. And if you have a catch-all .htaccess, it'll automatically route it to your app depending on how the .htaccess is set up. Since it's looking for the specific "page" class, you probably have a route designed to catch (:any) or something along those lines.

Just my guess based on what you've said. Maybe that'll help you track down your issue.
#8

[eluser]gmoore[/eluser]
Interesting...thanks for the reply! How could I go about stopping this behavior?

I believe my relevant htaccess looks like this (this is the one at the highest level of my project folder):

RewriteEngine on
RewriteCond $1 !^(index\.php|assets|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

#9

[eluser]gmoore[/eluser]
Don't want to speak to soon, but I think I've fixed this. Changed htaccess to:

RewriteEngine on
RewriteCond $1 !^(index\.php|assets|images|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ index.php/$1 [L]

And placed a favicon in the top level project folder.

Never thought favicons could cause so much trouble.
#10

[eluser]CroNiX[/eluser]
You shouldn't have to name everything you don't want to go through index.php. You just need to make sure the request isn't an actual file or directory that exists.

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Also, I'd put a favicon.ico and robots.txt file in your root directory, or your apache logs will be full of 404's for these. They can be just empty files, just so long as they exist.




Theme © iAndrew 2016 - Forum software by © MyBB