codeigniter hosting issue session_start(): Cannot send session cookie - codeigniter

enter image description hereI have created a web system using codeigniter. I don't have any errors while testing it in local host. after hosting the website to live host it generates some errors which cannot resolved. The errors is "session_start(): Cannot send session cookie ". I searched regarding this issue and did all possible changes in coding and config file. I have clearly define the session saving location in config. Also when I try to remove all session functionalities in my website, it generate another error which is "base_url() is not a function". Please guide further with solution. thanks all.

In application/config/config.php
$config['sess_save_path'] = sys_get_temp_dir();
Bang!
UPDATE: Regardless base_url() make sure you have the url helper loaded in the autoload.

Related

Laravel 5.4 : Login and singup working on shared hosting but not on VPS server

I move the project from shared hosting to VPS hosting now everything working fine such as inner pages, design, image loading but I am unable to login and signup now.
When I submit the login/Signup form it will redirect to the same page but without any error message.
And I also generate the Token via command do I need to do anything more to make it work.
I also check the laravel.log file and other things but unable to solve this.
Can anybody face the same issue
Issue is I do not create the session folder to store the session of Laravel 5.4

Laravel 5.4 change base address

I'm working on a Laravel 5.4 project and it's sandbox environment is this:
http://anything.com/sandbox/abc/www/public
I was asked to change it to:
http://anything.com/sandbox/xyz/www/public
After I change the folder via FTP and try to access the new URL I get this error message:
The requested URL /sandbox/abc/www/public/index.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I tried replacing the base url at the app/config.php and still didn't work.
The website is hosted in a cPanel server.
Any tips on what I should be trying? I just need to change the folder name. That's all.
Thanks for any help!
Answering my question: the problem was that there was a redirection in an .htaccess.

How to change URL according to server in dnn

I have Create a website in DotnetNuke using WebMetrix .The Website has been finished and run successfully on my local system . But when i moved my website to production server then instead of opening the Server URL it redirecting to my localhost URL.
So i think it requires any host setting or alias setting or URL setting from the Application or DB.Please suggest how can i resolve this issue.Any help will be Appreciated.
You will need to add a Portal Alias to the PortalAliases table, for the production URL. I would also recommend that you remove the testing URL from that table as well in production.

How to carry codeigniter session in domain alias?

I have two urls pointing to one application e.g
api.mysite.com & alias.mysite.com
Even if I set config:
$config['cookie_domain'] = ".mysite.com";
The session isn't carried over. I'm using the alias.mysite.com if the url will be seen by viewers via address bar when they are redirected after processing instead of having them see api.mysite.com
Appreciate any help or idea.
Thank you very much.
I believe you can find your answer here:
http://ellislab.com/forums/viewthread/57101/
Subdomain overwiting CodeIgniter session
sharing session over subdomains in PHP

PHP sessions or cookies not storing on server. PHP.ini misconfiguration

I am working on a simple SESSION/COOKIE login system for a website on a standard shared hosting account. The problem is that neither sessions or cookies are stored. My code is 100% correct but the server is misconfigured.
I have noticed that there was no folder in which to store sessions so I created one and added a local php.ini file. Sessions are stored in that folder properly but they don't work when I try to use them in my PHP website.
I have talked to support but they are very bad.
The server configuration is this: http://luttnerre.com/test.php
Thank you !
Have you checked the permissions on the specified directory? The php process needs to be able to write to it.
If cookies aren't being stored on client browsers then something is wrong with your code, these don't depend on the server session handling being configured correctly. If cookies aren't being stored, then sessions won't either so I'd look at the cookie problem first, then the session one.
Remember that cookies and session variables must be declared before any other output or you have to turn output buffering on. Check http://www.php.net/manual/en/function.ob-start.php
Even empty characters in a include before or after tags can lead to errors.
Also check your error_reporting level since some important debug messages could stay supressed. See http://php.net/manual/en/function.error-reporting.php

Resources