Welcome Guest, Not a member yet? Register   Sign In
Passing session id in the URL
#1

[eluser]simonspoken[/eluser]
I have a site which I'm currently moving over to CodeIgniter. Because of the nature of the site (a mobile site), there is no guarantee that cookies will be supported (either by the handset, or stripped out by the mobile network - it happens).

To combat this, I store a session id in both a cookie and the URL (cookie being the preferred method, because we can track repeat visits). On each load of the page, it goes off to the database and pulls out all the relevant information for that session.

For example, a URL on the non-CI site looks like this:
http://www.ourURL.mobi/97b549ce7c78c9d7/somepage
http://www.ourURL.mobi/97b549ce7c78c9d7/...notherpage

I'd like to replicate this across to CI, but I'm not sure where to begin. Can anyone point me in the right direction? I have the class doing the tracking now - I just need to get CodeIgniter to understand the URL's.
#2

[eluser]ekeretex[/eluser]
I think you will be better off adding the session parameter at the end of the url rather than where it is currently.

You could then test for that parameter in the controllers.
#3

[eluser]wiredesignz[/eluser]
Take a look at the user guide _remap() function, the first uri segment is passed to it so you can validate your sessions there, and then grab the other segments to get your pages
#4

[eluser]simonspoken[/eluser]
[quote author="wiredesignz" date="1203537426"]Take a look at the user guide _remap() function, the first uri segment is passed to it so you can validate your sessions there, and then grab the other segments to get your pages[/quote]

Great - this worked. Thanks for your help. Smile




Theme © iAndrew 2016 - Forum software by © MyBB