- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
is there any way to send PHP session to a URL??
such as if
<form action="http://index.rathorint.com/" method="post">
<input type="text" name="name">
<button type="submit" name="submit">
os is there any way to start a session in another url, which is already running on page, such as i want to send PHP session to lottery.rathorint.com from index.rathorint.com
Yes, though there are drawbacks for security (session hijacking is much easier) and usability (session id’s get stuck in history/bookmarks/search engines, breaking your session state).
then what is the proper way to handle it, i am working on a site and i want to send same session to the next url, such as
session is running on index.rathorint.com and i want to send it to lottery.rathorint.com , is that possible in good manner , avoiding hacking
If the two domains share a common parent (that you control), then you can configure the session cookie to apply to all your subdomains:
<?php
// these are simply the default values;
// we have to include them in order to set the $domain argument
$ttl = 0;
$path = '/';
// note the leading dot (.) in the domain
$domain = ".rathorint.com";
session_set_cookie_params( $ttl,$path,$domain );
session_start();
Hi
try $_COOKIES as well.