Thanks, Takashi,

I tried with CI 3.1.4 with sessions. I changed base URL for GAE. Previous 
versions can work without changing BASE URL.

I added  mysqli.default_socket= '/cloudsql/CONNECTION_NAME', As per reply.

*In the view I got issues, I fixed, Now working fine CI SESSIONS IN FE.*

*thanks for all Support. If I get any other issues Will contact you*


On Thursday, May 4, 2017 at 11:03:51 AM UTC+5:30, Dhandapani Sattanathan 
wrote:
>
> Hi Takashi,
>
> I enabled Cloud SQL API & added beta_settings in my app.yaml.
>
> I m using mysqli. I didn't used mysqli.default_socket= 
> '/cloudsql/CONNECTION_NAME in php.ini.
>
> Also, I used CodeIgniter 3.0.0. I 'll try with CodeIgniter 3.1.4 with 
> session & mysqli.default_socket in php.ini and Let you know the status.
>
> Thanks for immediate reply 
>
> -SN
>
> On Thursday, May 4, 2017 at 1:52:46 AM UTC+5:30, Takashi Matsuo (Google) 
> wrote:
>>
>>
>> Hi Dhandapani,
>>
>> Just a quick note, I downloaded CodeIgniter 3.1.4 and the session with 
>> the database backed by CloudSQL v2 works.
>>
>> Potential pitfalls are:
>>
>>    - You have to enable Cloud SQL API 
>>    
>> <https://console.cloud.google.com/apis/api/sqladmin.googleapis.com/overview>
>>    - You have to add beta_settings in your app.yaml
>>    ```
>>    beta_settings:
>>      cloud_sql_instances: "CONNECTION_NAME"
>>    ```
>>    - If you're using mysqli, put the default socket in php.ini
>>    ```
>>    mysqli.default_socket= '/cloudsql/CONNECTION_NAME'
>>    ```
>>
>> Hope it helps!
>>
>> On Wed, May 3, 2017 at 10:32 AM Takashi Matsuo <tma...@google.com> wrote:
>>
>>>
>>> Hi Dhandapani,
>>>
>>> Are you able to connect to the database in other part of your app?
>>> Are there any suspicious logs?
>>>
>>> On Wed, May 3, 2017 at 7:59 AM Justin Beckwith <beck...@google.com> 
>>> wrote:
>>>
>>>> + a few folks
>>>>
>>>> On Wed, May 3, 2017 at 2:51 AM, Dhandapani Sattanathan <
>>>> dhandapani....@ssomens.com> wrote:
>>>>
>>>>> I m migration my CRM application developed in CodeIgniter Framework 
>>>>> from GAE SE to Google App Engine flexible environment.
>>>>>
>>>>> UserService not available in GAE FE.So I used Integrating Google 
>>>>> Sign-In into your web app 
>>>>> <https://developers.google.com/identity/sign-in/web/sign-in>.
>>>>>
>>>>> I need session so I used the below.I am using CI_VERSION', '3.0.0
>>>>>
>>>>>
>>>>> application/config/config.php
>>>>> $config['sess_driver'] = 'database';
>>>>> $config['sess_cookie_name'] = 'ci_session';
>>>>> $config['sess_expiration'] = 7200;
>>>>> $config['sess_save_path'] = 'ci_sessions';
>>>>> $config['sess_match_ip'] = TRUE;
>>>>> $config['sess_time_to_update'] = 300;
>>>>> $config['sess_regenerate_destroy'] = FALSE;
>>>>>
>>>>> Using the below query I created the ci_sessions table in second 
>>>>> generation cloud SQL.
>>>>>
>>>>>
>>>>> CREATE TABLE IF NOT EXISTS `ci_sessions` (
>>>>> `id` varchar(40) NOT NULL,
>>>>> `ip_address` varchar(45) NOT NULL,
>>>>> `timestamp` int(10) unsigned DEFAULT 0 NOT NULL,
>>>>> `data` blob NOT NULL,
>>>>> PRIMARY KEY (id),
>>>>> KEY `ci_sessions_timestamp` (`timestamp`)
>>>>> );
>>>>>
>>>>>
>>>>> I can get session userstamp in ctrl_Index.php
>>>>>
>>>>>
>>>>> application/controllers/Ctrl_Index.php
>>>>> <?php
>>>>> defined('BASEPATH') OR exit('No direct script access allowed');
>>>>>
>>>>> class Ctrl_Index extends CI_Controller {
>>>>>
>>>>> public function index()
>>>>> {
>>>>> $userstamp=base64_decode($_GET['UserStamp']);
>>>>> $this->session->set_userdata('UserStamp', $userstamp);
>>>>> echo $this->session->userdata('UserStamp'); // here session id came.
>>>>> $this->load->view('Vw_Menu'); // Redirect to vw_menu page.
>>>>>
>>>>> }
>>>>> }
>>>>>
>>>>> ?>
>>>>>
>>>>>
>>>>> application/views/Vw_Menu.php
>>>>> <?php
>>>>> ?>
>>>>> <html>
>>>>> <head>
>>>>> <script src="
>>>>> https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js";
>>>>> ></script>
>>>>> <script>
>>>>> $(document).ready(function(){
>>>>> var CONFIG_ENTRY_controller_url="<?php echo base_url(); ?>" + 
>>>>> '/index.php/Ctrl_Menu/' ;
>>>>> $.ajax({
>>>>> type: "POST",
>>>>> url':CONFIG_ENTRY_controller_url+"getSessionUserstamp",
>>>>> success: function(data){
>>>>> $(".preloader").hide();
>>>>> var userstamp=(data);
>>>>> alert(userstamp)
>>>>>
>>>>> });
>>>>>
>>>>> });
>>>>> </script>
>>>>> <title>CI SESSION IN GAE FE</title>
>>>>> <meta charset="utf-8">
>>>>> </head>
>>>>> <body id="bodyMenuMsg">
>>>>> <form class="form-horizantal">
>>>>>
>>>>> </form>
>>>>> </body></html>
>>>>>
>>>>>
>>>>> From Ctrl_index.php redirect to vw_menu.php session got empty.Also 
>>>>> ci_sessions tables ip_address saved as empty.
>>>>>
>>>>>
>>>>> My sample script can see here [1] 
>>>>> <https://docs.google.com/spreadsheets/d/1hZ2ZUlz3LSm7sxJP6LCRtKBVHkgzQ6J2Nj3xwvsipXc/edit#gid=0>,
>>>>>  
>>>>> Download Codeigniter here [2] 
>>>>> <https://github.com/bcit-ci/CodeIgniter/releases/tag/3.0.0> replace 
>>>>> my sample script.
>>>>>
>>>>>
>>>>> Will ci-sessions using database work in GAE FE?.Is there any other 
>>>>> alternative to using ci-session in GAE FE?
>>>>>
>>>>>
>>>>> Maybe I missed configuring in GAE FE to work ci_session?
>>>>>
>>>>>
>>>>> Please help me.
>>>>>
>>>>>
>>>>> Thanks in advance
>>>>>
>>>>>
>>>>> SN
>>>>>
>>>>> -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "Google App Engine" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to google-appengi...@googlegroups.com.
>>>>> To post to this group, send email to google-a...@googlegroups.com.
>>>>> Visit this group at https://groups.google.com/group/google-appengine.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/google-appengine/5220d656-7264-4d89-9841-075f6e1576fc%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/google-appengine/5220d656-7264-4d89-9841-075f6e1576fc%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>> -- 
>>>>
>>>> Justin Beckwith | Google Cloud Platform | @justinbeckwith 
>>>> <http://twitter.com/JustinBeckwith> | http://jbeckwith.com
>>>>
>>> -- 
>>> -- Takashi
>>>
>> -- 
>> -- Takashi
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/d5dbc018-9fd7-4dab-bace-a30aee6b7e58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to