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.
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], Download Codeigniter here [2] 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-appengine+unsubscribe@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/5220d656-7264-4d89-9841-075f6e1576fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
+ a few folks
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.
For more options, visit https://groups.google.com/d/optout.
--