Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Advanced php

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #37231
    mailmevenkat
    Member

    hi guys i’m new to css-tricks forum. I have a problem in php its some what advanced. I want my session to be accessible by all my sub domain. That is if a user login to http://www.example.com then the user should also be logged in sub.example.com . I used session_set_cookie_params(time() + 3600, ‘/’,’.domain.com’,false,false) it works fine in http://www.example.com and example.com but not in m.example.com . Can anyone help of out?

    #99449
    Blackhawkso
    Member

    The only thing I can think of is if you use $_SESSION to store the data it should keep the person logged in across the main and sub domains.

    #99474
    mailmevenkat
    Member

    @karlpcrowley you mean to change php configuration. I tried it but after changing it the session is not even stored . So only i tried to do it via script


    @blackhawkso
    no it only works in the domain or sub domain where we store the session.

    Thanks for the replies.

    #99483
    mailmevenkat
    Member

    @karlpcrowley i tried to set it before but it failed . Now i use something like this
    session_set_cookie_params(time() + 3600,'/','.example.com');
    session_start();

    I tried to use example.com instead of .example.com but now i can’t even login.

    #99493
    Blackhawkso
    Member

    Sorry just posted a link but then found out that it don’t work in PHP so ignore me lol

    #99533
    Blackhawkso
    Member

    I’ve just found this link for a tutorial on a way to get cookies to work cross domains

    http://www.phpbuilder.com/columns/chriskings20001128.php3

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Back End’ is closed to new topics and replies.