PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, March 14, 2022

[FIXED] how i can access session in route.php in codeigniter 3.0

 March 14, 2022     codeigniter, codeigniter-3, php     No comments   

Issue

how i can access session in route.php in codeigniter 3.0

my application is multi language support so i can used session for language change my application data , lable,static captions language change

now i want to extend my application

means when language change that time url also change means

for example

http://localhost/test/en/controller/method

when change language in spainsh that time url change like below

http://localhost/test/es/controller/method

so how i can do this

please help me thanks


Solution

You always can access to the $_SESSION variable. However, I'm not sure if it's compatible with CodeIgniter Session library.

session_start();

if(isset($_SESSION['lang']))
{
   // define your routing here
}


Answered By - Alexander Popov
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing