Custom Session usind MySQL

This is a discussion on Custom Session usind MySQL within the PHP General forums, part of the PHP Programming Forums category; I want the session to be accessed from different websites, so i got the answer in this forum only to ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-19-2003
Manisha Sathe
 
Posts: n/a
Default Custom Session usind MySQL

I want the session to be accessed from different websites, so i got the
answer in this forum only to make use of customised session with mysql.

I searched the web and came to know that 'session.save_handler' of php.ini
needs to be as 'user' but instead, on my server it is 'files'. As server is
a shared server so i may not be able to change it, what can i do to resolve
this ?

Thanks in advance
Manisha
Reply With Quote
  #2 (permalink)  
Old 11-19-2003
Manisha Sathe
 
Posts: n/a
Default Re: [PHP] Custom Session usind MySQL

yes, website is on same machine, but if there is to and fro from 2 websites,
then for both ways i need to pass it ? what will happen to session time
limit ? if i go website1 then go to another website2 then after 30 mins i
come back to website1 (session timeout 30mins) then what will happen ? Any
sample code would be appreciated.

if at all i decide to go for database then do i need 'session.save_handler'
as 'user' ?

manisha


> Manisha Sathe wrote:
>
> > I want the session to be accessed from different websites, so i got the
> > answer in this forum only to make use of customised session with mysql.
> >
> > I searched the web and came to know that 'session.save_handler' of

php.ini
> > needs to be as 'user' but instead, on my server it is 'files'. As server

is
> > a shared server so i may not be able to change it, what can i do to

resolve
> > this ?

>
> Are both websites on the same machine? If so, you can just use a common
> session.save_path and pass the session_id when changing servers.
>
> If the websites are on different machines, then you'll need to use a
> database for sessions and ensure the database is accessible by each site.
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com

Reply With Quote
  #3 (permalink)  
Old 11-19-2003
John W. Holmes
 
Posts: n/a
Default Re: [PHP] Custom Session usind MySQL

Manisha Sathe wrote:

> yes, website is on same machine, but if there is to and fro from 2 websites,
> then for both ways i need to pass it ? what will happen to session time
> limit ? if i go website1 then go to another website2 then after 30 mins i
> come back to website1 (session timeout 30mins) then what will happen ? Any
> sample code would be appreciated.


Nothing will happen as you'll be using the same session file so it will
not be cleaned up. What don't you try reading the page for
session_set_save_handler() and start from there...

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
Reply With Quote
  #4 (permalink)  
Old 11-19-2003
Greg Donald
 
Posts: n/a
Default Re: [PHP] Custom Session usind MySQL

On Wed, 19 Nov 2003, Manisha Sathe wrote:

>I want the session to be accessed from different websites, so i got the
>answer in this forum only to make use of customised session with mysql.
>
>I searched the web and came to know that 'session.save_handler' of php.ini
>needs to be as 'user' but instead, on my server it is 'files'. As server is
>a shared server so i may not be able to change it, what can i do to resolve
>this ?
>


Basically you just need to override the default session handler and
provide your own session functions that will use a MySQL table instead of
/tmp. Try this:

http://destiney.com/pub/php_db_sessions.tar.gz


--
Greg Donald
http://destiney.com
Reply With Quote
  #5 (permalink)  
Old 11-19-2003
Manisha Sathe
 
Posts: n/a
Default Re: Custom Session usind MySQL

thanks all for your help, will try it out now

manisha

"Manisha Sathe" <manisha@starhub.net.sg> wrote in message
news:20031119004047.6587.qmail@pb1.pair.com...
> I want the session to be accessed from different websites, so i got the
> answer in this forum only to make use of customised session with mysql.
>
> I searched the web and came to know that 'session.save_handler' of php.ini
> needs to be as 'user' but instead, on my server it is 'files'. As server

is
> a shared server so i may not be able to change it, what can i do to

resolve
> this ?
>
> Thanks in advance
> Manisha

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:09 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0