Cookie/session gets lost |
Hi there,
I've integrated uploadify (file/image uploader). It worked great with CI older versions. After the upgrade to CI 3, sessions have been completely rewritten, and I'm confused a bit. 'uploader' : '<?=site_url("/photo/uploadFile")?>', I check if a user is login or not PHP Code: public function uploadFile() What is the approach in caring cookie/session in this case? Here is javascript in my view page. Code: <script type="text/javascript">
I don't know but if your code was working before upgrading, it might be a problem with the Tank Auth Library (don't know this library)
are you sure tank auth is working fine with CI 3? (03-03-2015, 01:50 AM)sintakonte Wrote: I don't know but if your code was working before upgrading, it might be a problem with the Tank Auth Library (don't know this library) Yes, Tank Auth library is working just fine. When I var_dump the session before uploading it shows the session in CI 2.x.x. PHP Code: <?php var_dump($this->session->sess_cookie_name); ?> But it doesn't in CI 3. Is this deprecated $this->session->sess_cookie_name?
Have you tried just getting it from config? Don't rely on undocumented or internal features/properties!! They can change without warning.
Code: $this->config->item('sess_cookie_name'); (03-03-2015, 08:44 AM)CroNiX Wrote: Have you tried just getting it from config? Don't rely on undocumented or internal features/properties!! They can change without warning. Yes I tried that. Before the cookie/session looked like this: ci_session Code: a%3A4%3A%7Bs3A%22[b]session_id[/b]%22%3Bs%3A32e47be9d1848e53f459063d14a4e6514b%22%3Bs%3A10%3A%22[b]ip_address[/b]%22%3Bs%3A3%3A%22%3A%3A1%22%3Bs%3A10%3A%22[b]user_agent[/b]%22%3Bs%3A82%3A%22Mozilla%2F5.0+%28Macintosh%3Bv%3A35.0%29+Gecko%2F20100101+Firefox%2F35.0%22%3Bs%3A13%3A%22[b]last_activity[/b]%22%3Bi%3A14253950237d5bc5393a9281301ed537c360b2b With CI3 it looks like this: ci_session Code: f8429902b1b0a615a208666386c525a4693fc606 The link Add pictures goes to photo/upload function, and there I check if user is logged in. This one works fine. PHP Code: public function upload() But in this method, the session gets lost. This redirects to uploadFile() which is under the same class as the above function. 'uploader' : '<?php echo site_url("/photo/uploadFile")?>', PHP Code: public function uploadFile()
Here is the cookie function
Code: /*jshint eqnull:true */ |
Welcome Guest, Not a member yet? Register Sign In |