Codeigniter 3.1.9 : Session Lost when using redirect - codeigniter-3

I faced one issue when upgraded codeigniter 2.2.0 into 3.1.9
Ex : I'm set a session in page1 and then redirecting into page2. After redirect, Unable to get page1 session into page2. In page2, I printed the session is showing empty.
Page1:
$this->session->set_userdata('user', $data );
Page2:
$user = $this->session->userdata('user');
I'm not facing this issue in codeigniter 2. Only facing in Codeigniter3.

Your code is OK.
Before using session library in codeigniter you need to configure session driver and load the session library, make sure you have correct setup.
To configure session driver goto /application/config/config.php, if you are using files for session driver make sure you have read and write permission for $config['sess_save_path'] location.
You can autoload the session library by adding session to $autoload['libraries'] array in /application/config/autoload.php

Related

Laravel 8.75 multiple authentication Routing issue

I am working on laravel 8.75 with php 7.4.9.
I am facing issue in laravel route getting error too many redirects.
I want to create route http:127.0.0.1:8000/admin/login
by firing command php artisan route:list i am getting routes like this
I see you are using the same url (admin/login) in get method and post method of login page
So try to change the url to one of them and try again after run php artisan route:clear

Codeigniter session is not working on PHP 7.3.0

I am using codeigniter version 3.1.10 on PHP 7.3.0.when i am setting and retriving sesssion from same method means it will work. when try to accesss session from different method from the same controller and
from different controller will not work.
this is how i set the session
$this->session->set_userdata('somename','10');
get session
$this->session->userdata('somename');

Apache Shiro and Wildfly 8.1 JSESSIONID issue

I have migrated Wildfly server from 8.0 final to 8.1 final and Apache Shiro started having problems when creating user sessions.
The exact same application runs without any problem on 8.0 final but with 8.1 users cannot establish sessions every time they log in they are redirected to the login page even though they were authenticated successfully.
I cannot figure out what has changed since 8.0 that would cause this issue.
Changing the cookie name "JSESSIONID" to something else fixed the issue.
Here how I modified my shiro config
sessionManager=org.apache.shiro.web.session.mgt.DefaultWebSessionManager
securityManager.sessionManager=$sessionManager
securityManager.sessionManager.sessionIdCookieEnabled = true
cookie = org.apache.shiro.web.servlet.SimpleCookie
cookie.name = here.pick.your.session.id
sessionManager.sessionIdCookie = $cookie

Setting moodle online

Good day everyone, I have been trying to put my moodle online so pcs from internet can access it, but until now, no luck at all. (Im using moodle 2.3.2 on Windows Server 2008 and IIS 7).
I tried to configure the moodle file config.php, setting the directive $CFG -> wwwroot = "my-public-ip/moodle". Then, when I access to moodel from the server, I can access it by "http://my-public-ip/moodle", when I try to access via localhost, it sends an error which it is OK.
But the funny part comes when I try to access the server from an outside pc. When I type "http://my-public-ip/moodle" it simply cant "see" the configuration I made to the config.php file (it says: This server cna only be accessed via localhost/moodle) it looks like the outside pcs are either ignoring it, or searching for another configuration file. I dont know what the hell is happening, this is very odd.
Any ideas?? tnx!!!
Change the following file:
lib-->setuplib.php
Redirect ($CFG->wwwroot, get_string('wwwrootmismatch', 'error', $CFG->wwwroot), 3);
for
Redirect ($CFG->wwwroot, get_string('wwwrootmismatch', 'error', $CFG->wwwroot), 0);
I realise this is an old question, but it's also worth pointing out you may need to also run the database search and replace script, at:
http://my-public-ip/moodle/admin/tool/replace/index.php
as referenced in Method 2 here.
This is required if you change the name of the site once you have installed it. If you were already using Moodle under "localhost", then there will be a number of references to the old localhost address stored in the database that need to be updated to the new IP-based address.
It might be because the http:// part is missing?
$CFG->wwwroot = "my-public-ip/moodle"
should be
$CFG->wwwroot = "http://my-public-ip/moodle"

Problem with Joomla auto logoff feature

I am using joomla 1.5.14(Stable),PHP Version: 5.2.6,Web Server: Apache/2.2.3 (CentOS), CBSub: 1.2.1.
My login is with cbsub, I have added an IP check for user in login function in comprofiler.php. As I added my code for check, auto log off feature of Joomla is not working properly. Can anyone suggest how can I enable auto log off feature without deleting my IP check.
Thanks in advance!!
Gurpreet Kaur
Just change the session time in Global Configuration.